34 lines
804 B
PHP
34 lines
804 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreMediaRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'file' => [
|
|
'required',
|
|
'file',
|
|
'max:512000', // 500MB
|
|
'mimetypes:image/jpeg,image/png,image/gif,image/webp,video/mp4,video/quicktime,video/webm,application/pdf',
|
|
],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'file.required' => 'O arquivo é obrigatório.',
|
|
'file.max' => 'O arquivo deve ter no máximo 500MB.',
|
|
'file.mimetypes' => 'Tipo de arquivo não suportado.',
|
|
];
|
|
}
|
|
}
|