diff --git a/src/App/Http/Controllers/UsersManagementController.php b/src/App/Http/Controllers/UsersManagementController.php index aa48a52..0e6bb2a 100755 --- a/src/App/Http/Controllers/UsersManagementController.php +++ b/src/App/Http/Controllers/UsersManagementController.php @@ -91,7 +91,7 @@ public function create() public function store(Request $request) { $rules = [ - 'name' => 'required|string|max:255|unique:users', + 'name' => 'required|string|max:255|unique:users|alpha_dash', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|string|confirmed|min:6', 'password_confirmation' => 'required|string|same:password', @@ -104,6 +104,7 @@ public function store(Request $request) $messages = [ 'name.unique' => trans('laravelusers::laravelusers.messages.userNameTaken'), 'name.required' => trans('laravelusers::laravelusers.messages.userNameRequired'), + 'name' => trans('laravelusers::laravelusers.messages.userNameInvalid'), 'email.required' => trans('laravelusers::laravelusers.messages.emailRequired'), 'email.email' => trans('laravelusers::laravelusers.messages.emailInvalid'), 'password.required' => trans('laravelusers::laravelusers.messages.passwordRequired'), @@ -199,7 +200,7 @@ public function update(Request $request, $id) ]; if ($emailCheck) { - $rules['email'] = 'required|email|max:255|unique:users'; + $rules['email'] = 'required|email|max:255|unique:users|alpha_dash'; } if ($passwordCheck) { diff --git a/src/resources/lang/en/laravelusers.php b/src/resources/lang/en/laravelusers.php index 1154d11..f4ae4e6 100644 --- a/src/resources/lang/en/laravelusers.php +++ b/src/resources/lang/en/laravelusers.php @@ -54,6 +54,7 @@ 'messages' => [ 'userNameTaken' => 'Username is taken', 'userNameRequired' => 'Username is required', + 'userNameInvalid' => 'Username is invalid', 'fNameRequired' => 'First Name is required', 'lNameRequired' => 'Last Name is required', 'emailRequired' => 'Email is required',