<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ArticleStoreRequest 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 [
           /* 'titre' => ['required', 'string', 'min:3'],
            'miniature' => ['required', 'string', 'min:3'],
            'sections' => ['required', 'array'],
            'sections.*.titre' => ['required', 'string', 'min:3'],
            'sections.*.paragraphes' => ['required', 'array'],
            'sections.*.paragraphes.*' => ['required', 'min:3'],
            'sections.*.image' => ['nullable'],
            'sections.*.image.nom' => ['required_with:sections.*.image', 'string', 'min:3'],
            'sections.*.image.url' => ['required_with:sections.*.image', 'string', 'min:3'],
            'attachements' => ['nullable', 'array'],
            'attachements.*.nom' => ['required', 'string', 'min:3'],
            'attachements.*.url' => ['required', 'string', 'min:3']*/
        ];
    }
}
