app/Http/Requests/UpdatePostRequest.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|max:255',
            'slug'          => "required|alpha-dash|min:5|max:255|unique:posts,slug," . $this->id,
            'category_id'   => 'required|integer',
            'body'          => 'required',
            'image'         => 'sometimes|image|mimes:jpeg,jpg,png,bmp,gif',
        ];
    }
public function rules ( ) { return [ 'title' => 'required|max:255' , 'slug' => " required|alpha-dash|min:5|max:255|unique:posts,slug, " . $ this -> id , 'category_id' => 'required|integer' , 'body' => 'required' , 'image' => 'sometimes|image|mimes:jpeg,jpg,png,bmp,gif' , ] ; }
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