首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP错误:类“照明/基础/8月/管理”[Laravel 8]

PHP错误:类“照明/基础/8月/管理”[Laravel 8]
EN

Stack Overflow用户
提问于 2020-09-12 05:39:37
回答 1查看 1.6K关注 0票数 1

当我尝试使用修补程序插入管理数据时,我遇到了php错误的问题。我正在创建一个多身份验证用户,这是一个用户和一个管理。

PHP错误:在第13行的c:/S/htdocs/ in /app/Models/Admin.php中找不到

如何解决该错误?

Admin

代码语言:javascript
复制
<?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文件,然后再次安装它,我也这样做了。

代码语言:javascript
复制
composer dump-autoload
composer install --no-scripts
composer update
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63857207

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档