mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
e973f68537
* feat(admin): upload video action * style: fix StyleCI findings * tests: fix video storage tests
41 lines
866 B
PHP
41 lines
866 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Rules\Wiki\Submission\Audio;
|
|
|
|
use App\Rules\Wiki\Submission\SubmissionRule;
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
/**
|
|
* Class AudioChannelLayoutStreamRule.
|
|
*/
|
|
class AudioChannelLayoutStreamRule extends SubmissionRule
|
|
{
|
|
/**
|
|
* Determine if the validation rule passes.
|
|
*
|
|
* @param string $attribute
|
|
* @param UploadedFile $value
|
|
* @return bool
|
|
*/
|
|
public function passes($attribute, $value): bool
|
|
{
|
|
$audio = $this->streams()
|
|
->audios()
|
|
->first();
|
|
|
|
return $audio !== null && $audio->get('channel_layout') === 'stereo';
|
|
}
|
|
|
|
/**
|
|
* Get the validation error message.
|
|
*
|
|
* @return string|array
|
|
*/
|
|
public function message(): string|array
|
|
{
|
|
return __('validation.submission.audio_channel_layout');
|
|
}
|
|
}
|