亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

PHP 錯誤:類“Illuminate/Foundation/Auth/Admin”

PHP 錯誤:類“Illuminate/Foundation/Auth/Admin”

PHP
紅顏莎娜 2024-01-19 09:48:57
當我嘗試使用修補程序插入管理員數據時,我遇到了 php 錯誤問題。我正在創建一個多重身份驗證用戶,其中一個用于用戶,一個用于管理員。PHP 錯誤:在第 13 行的 c:/S/htdocs/iV/app/Models/Admin.php 中找不到類“Illuminate/Foundation/Auth/Admin”我該如何解決該錯誤?Admin<?phpnamespace 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
查看完整描述

1 回答

?
忽然笑

TA貢獻1806條經驗 獲得超5個贊

改變這個

use Illuminate\Foundation\Auth\Admin as Authenticatable;

use Illuminate\Foundation\Auth\User as Authenticatable;

因為Illuminate\Foundation\Auth\User它是來自 laravel core 的核心代碼,并且沒有Admin


查看完整回答
反對 回復 2024-01-19
  • 1 回答
  • 0 關注
  • 132 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號