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