0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

laravel のログイン機能をnameでログインへ変更する機能

Last updated at Posted at 2020-01-16
以下の手順で上手く行きました。
1

2014_10_12_000000_create_users_table.php

$table->string('name')->unique();

2
LoginController.php

public function username()		
{	
 return 'name';	
}		

3

login.blade.php

<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">	

    <label for="email" class="col-md-4 control-label">Name</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>	

動作確認OK

拍手!

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?