1
1

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 3 years have passed since last update.

Laravel 5.5 で remember_tokenカラムを使わない方法

Last updated at Posted at 2020-01-01

Laravel5.5でremember_tokenカラムがない状態ログアウトすると、`remember_token'カラムがないとエラーでました。

User.php

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    protected $rememberTokenName = false; //ここ

                                                                           
AuthenticatableトレイトにrememberTokenNameという、カラム名を指定できるものがあるのでこれをオーバーライドしてfalseに設定します。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?