label(__('filament.actions.audio.upload.name')); $this->authorize('create', Audio::class); } /** * Get the underlying storage action. * * @param array $fields * @return UploadAudio */ protected function storageAction(array $fields): UploadAudio { /** @var UploadedFile $file */ $file = Arr::get($fields, 'file'); /** @var string $path */ $path = Arr::get($fields, 'path'); return new UploadAudio($file, $path); } /** * The name of the disk. * * @return string */ public function disk(): string { return Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED); } /** * Get the file validation rules. * * @return array */ protected function fileRules(): array { return [ 'required', FileRule::types('ogg')->max(200 * 1024), new TotalStreamsFormatRule(1), new EncoderNameFormatRule(), new EncoderVersionFormatRule(), new FormatNameFormatRule('ogg'), new AudioBitrateRestrictionFormatRule(), new ExtraneousMetadataFormatRule(), new ExtraneousChaptersFormatRule(), new AudioIndexStreamRule(0), new AudioCodecStreamRule(), new AudioSampleRateStreamRule(), new AudioChannelsStreamRule(), new AudioChannelLayoutStreamRule(), new AudioLoudnessTruePeakStreamRule(), new AudioLoudnessIntegratedTargetStreamRule(), ]; } }