Laravel-BadMethodCallException调用未定义的方法App\User::getAuthIdentifierName()

Laravel-BadMethodCallException调用未定义的方法App\User::getAuthIdentifierName(),laravel,authentication,Laravel,Authentication,我知道这个问题已经被问过很多次了,但是没有一个答案是有用的。部分原因是,大多数答案都说要做已经做过的事情。每个页面都会出现错误:“BadMethodCallException调用未定义的方法App\User::getAuthIdentifierName() 事情是这样的。身份验证工作正常。然后我做了一个新的迁移: php artisan migrate:fresh --seed 之后,错误出现了 以下是我的应用程序/用户型号代码: <?php namespace App; use I

我知道这个问题已经被问过很多次了,但是没有一个答案是有用的。部分原因是,大多数答案都说要做已经做过的事情。每个页面都会出现错误:“BadMethodCallException调用未定义的方法App\User::getAuthIdentifierName()

事情是这样的。身份验证工作正常。然后我做了一个新的迁移:

php artisan migrate:fresh --seed
之后,错误出现了

以下是我的应用程序/用户型号代码:

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use jeremykenedy\LaravelRoles\Traits\HasRoleAndPermission;
use Illuminate\Database\Eloquent\SoftDeletes;

class User extends Authenticatable implements MustVerifyEmail
// class User extends Authenticatable
{
    use SoftDeletes;
    use Notifiable;
    use HasRoleAndPermission;

    protected $dates = ['deleted_at'];

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

看来是浏览器中保存的cookies导致了错误。我清除了缓存,现在可以加载了。将问题标记为已解决,但之前访问过该站点的每个浏览器都有相同的问题。有没有一种方法可以通过编程方式清除用户的站点cookie?