src/Http/Requests/PostFormRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'title' => ['required', 'string'],
            'body' => ['required', 'string'],
            'category' => ['nullable', 'exists:cms_categories,id'],
            'picture' => ['nullable', 'image'],
            'postType' => ['required', Rule::in(['draft','published'])],
            'tags' => ['nullable', 'string'],
        ];
    }
public function rules ( ) { return [ 'title' => [ 'required' , 'string' ] , 'body' => [ 'required' , 'string' ] , 'category' => [ 'nullable' , 'exists:cms_categories,id' ] , 'picture' => [ 'nullable' , 'image' ] , 'postType' => [ 'required' , Rule :: in ( [ 'draft' , 'published' ] ) ] , 'tags' => [ 'nullable' , 'string' ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .