Go to Vendor\laravel\framework\src\Illuminate\Foundation\Auth\AuthenticatesUsers.php
Search for the method username and return name instead of email
public function username()
{
return 'name';
}
Change the login field in login page to allow username as input value.
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-4 control-label">Username</label>
<div class="col-md-6">
<input id="name" type="name" class="form-control" name="name" value="{{ old('name') }}" required autofocus>
@if ($errors->has('name'))
<span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
</div>
Now you can login with your username.
Sign in to help the community by answering this question.
Log In to Answer
Comments