How to use username for logging in instead of email in Laravel 5.3? -
how can set login system in laravel 5.3 instead of email?
i tried add in logincontroller.php
public function username(){ return 'username'; }
so far doing right. authenticate other email
field have override username()
method did. think didn't changed login view. have change name of text field. talking views/auth/login.blade.php , chunk of code:
<div class="form-group {{ $errors->first('email', 'has-error') }}"> {!! form::label('email', trans('account/form.email'), ['class' => 'col-sm-2 control-label']) !!} <div class="col-sm-4"> {!! form::text('email', old('email'), ['class' => 'form-control']) !!} </div> <div class="col-sm-4"> {!! $errors->first('email', '<span class="help-block">:message</span>') !!} </div> </div>
replace every email
username
.
Comments
Post a Comment