Your IP : 216.73.216.79


Current Path : /var/www/html/reddsis/app/Http/Requests/Backend/
Upload File :
Current File : /var/www/html/reddsis/app/Http/Requests/Backend/ContentSliderRequest.php

<?php

namespace App\Http\Requests\Backend;

use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;

class ContentSliderRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'slider_portal' => 'nullable|string|max:255',
            'slider_status' => 'nullable|string|max:255',
            'slider_sort' => 'nullable|integer|min:0',
            'slider_url_type' => 'nullable|string|max:255',
            'slider_url' => 'nullable|string|max:255',
            'slider_url_upload' => 'nullable|file|max:10240',
            'slider_type' => 'nullable|string|max:255',
            'slider_dimension' => 'nullable|string|max:255',
            'slider_transition' => 'nullable|string|max:255',
            'slider_start_date' => 'nullable|date',
            'slider_start_time' => 'nullable',
            'slider_end_date' => 'nullable|date',
            'slider_end_time' => 'nullable',

            'translations' => 'nullable|array',
            'translations.*.title' => 'nullable|string|max:255',
            'translations.*.img' => 'nullable|image|mimes:jpg,jpeg,png,webp|max:20480',
            'translations.*.language' => 'nullable|string|max:255',
            'translations.*.main' => 'nullable|boolean',
        ];
    }

    public function messages(): array
    {
        return [
            'slider_sort.integer' => 'Sort order must be a number.',
            'slider_sort.min' => 'Sort order must be at least 0.',
        ];
    }
}