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