Files
AndyTranscribe/app/Http/Requests/StoreRecordingRequest.php
T

37 lines
810 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreRecordingRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'audio' => ['required', 'file', 'mimes:mp3,mpeg', 'max:102400'],
'title' => ['nullable', 'string', 'max:255'],
];
}
/**
* @return array<string, string>
*/
public function messages(): array
{
return [
'audio.required' => 'Please choose an MP3 file to upload.',
'audio.mimes' => 'Only MP3 files are supported.',
'audio.max' => 'The audio file may not be larger than 100 MB.',
];
}
}