user()->isAdmin() || auth()->user()->isOwner(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'set_react_as_default_ap' => 'required|bail|bool' ]; } protected function prepareForValidation() { $input = $this->all(); $cleaned_input = array_intersect_key( $input, array_flip(['set_react_as_default_ap'])); $this->replace($cleaned_input); } }