[ FilterVars::class => [ 'filter' => FILTER_SANITIZE_STRING ] ], ]; /** * Determine if the user is authorized to make this request. * * @return boolean */ public function authorize() { return auth()->check(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { if ($this->isMethod('post')) { return [ 'name' => 'required|string|min:5|max:255', 'brand_id' => 'required|exists:brands,id' ]; } return []; } }