当我尝试使用修补程序插入管理数据时,我遇到了php错误的问题。我正在创建一个多身份验证用户,这是一个用户和一个管理。
PHP错误:在第13行的c:/S/htdocs/ in /app/Models/Admin.php中找不到
如何解决该错误?
Admin
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\Admin as Authenticatable;
use Illuminate\Notifications\Notifiable;
use App\Notifications\AdminResetPasswordNotification;
class Admin extends Authenticatable
{
use HasFactory, Notifiable;
protected $guard = 'admin';
/**
* 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',
];
}

我已经尝试删除composer.lock文件,然后再次安装它,我也这样做了。
composer dump-autoload
composer install --no-scripts
composer update发布于 2020-09-12 05:41:56
更改此
use Illuminate\Foundation\Auth\Admin as Authenticatable;
至
use Illuminate\Foundation\Auth\User as Authenticatable;
作为Illuminate\Foundation\Auth\User,它是来自laravel的核心代码,没有Admin类
https://stackoverflow.com/questions/63857207
复制相似问题