<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ContenuStoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [

            "id_page" => "required",
            "id_contenant" => "required",
            "nom_contenu" => "required",
            "type" => "required",
            "valeur_texte" => "required_without_all:image_url,video_url",
            "image_url" => "required_without_all:valeur_texte,video_url",
            "description_image" => "nullable",
            "video_url" => "required_without_all:valeur_texte,image_url",
            "description_video" => "nullable",
        ];
    }
}
