openclassify/Modules/Panel/App/Http/Requests/UpdateVideoRequest.php
2026-03-14 01:57:30 +03:00

34 lines
942 B
PHP

<?php
namespace Modules\Panel\App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateVideoRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'listing_id' => ['required', 'integer', 'exists:listings,id'],
'title' => ['nullable', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:2000'],
'video_file' => ['nullable', 'file', 'mimes:mp4,mov,webm,m4v', 'max:256000'],
'is_active' => ['nullable', 'boolean'],
];
}
public function messages(): array
{
return [
'listing_id.required' => 'Choose a listing for the video.',
'listing_id.exists' => 'Choose a valid listing for the video.',
'video_file.mimes' => 'Video must be an mp4, mov, webm, or m4v file.',
];
}
}