| Current Path : /var/www/html/dev/reddsis-dev/app/Http/Requests/Backend/ |
| Current File : /var/www/html/dev/reddsis-dev/app/Http/Requests/Backend/ContentPhotoListRequest.php |
<?php
namespace App\Http\Requests\Backend;
use Illuminate\Foundation\Http\FormRequest;
class ContentPhotoListRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'photo_gallery_id' => 'nullable|integer|exists:content_photo_gallery,gallery_id',
'photo_main' => 'nullable|integer',
'photo_parent_id' => 'nullable|integer',
'photo_sort' => 'nullable|integer|min:0',
'photo_url' => 'nullable|image|mimes:jpg,jpeg,png,webp|max:5120',
'translations' => 'nullable|array',
'translations.*.descr' => 'nullable|string',
'translations.*.main' => 'nullable|boolean',
];
}
public function messages(): array
{
return [
'photo_gallery_id.exists' => 'Selected gallery does not exist.',
'photo_url.image' => 'File must be an image.',
'photo_url.max' => 'Image must not exceed 5MB.',
'photo_sort.integer' => 'Sort must be a number.',
'photo_sort.min' => 'Sort must be at least 0.',
];
}
}