"required|alpha_dash|min:5|unique:users,username,$this->id,id" ]; } protected function failedValidation(Validator $validator) { $response = redirect() ->route('dashboard.settings.index') ->withInput(['active_tab' => 'security']) ->withErrors($validator); throw (new ValidationException($validator)) ->errorBag($this->errorBag) ->redirectTo($this->getRedirectUrl()); } }