app/Http/Requests/CreateRecipeRequest.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|regex:/^[\pL\s\-]+$/u|min:5|max:255',
            'ingredients'   => 'required',
            'methodology'   => 'required',
            'image'         => 'sometimes|image',
            'category_id'   => 'required|integer',
            'servings'      => 'required|integer',
            'prep_time'     => 'required|integer',
            'cook_time'     => 'required|integer',
            'source'        => 'sometimes',
            'personal'      => 'sometimes',
            'author_notes'  => 'sometimes',
            'public_notes'  => 'sometimes',
        ];
    }
public function rules ( ) { return [ 'title' => 'required|regex:/^[\pL\s\-]+$/u|min:5|max:255' , 'ingredients' => 'required' , 'methodology' => 'required' , 'image' => 'sometimes|image' , 'category_id' => 'required|integer' , 'servings' => 'required|integer' , 'prep_time' => 'required|integer' , 'cook_time' => 'required|integer' , 'source' => 'sometimes' , 'personal' => 'sometimes' , 'author_notes' => 'sometimes' , 'public_notes' => 'sometimes' , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
// https://laravel.com/docs/5.2/validation#available-validation-rules