authentication - Allow username instead of e-mail in default Laravel 5.0 AuthController -
laravel 5.0 comes "out of box" authcontroller configured handle user registrations , logins.
is possible , configure/modify default configuration use more general "username" instead of e-mail address?
ideally, i'd users table have unique username instead of e-mail address; but, i'd settle turning off part of validator insists "e-mail address" field on login page formatted e-mail address.
(i figured out how turn off client-side validation; but, can't figure out how turn off server-side validation --- part generates "whoops: ... email must valid email address." message.)
the default validation rules defined in app\services\registrar
. remove email
rule validator
method:
public function validator(array $data) { return validator::make($data, [ 'name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', // ^^^^^ 'password' => 'required|confirmed|min:6', ]); }
Comments
Post a Comment