PHP Error: Class 'Illuminate/Foundation/Auth/Admin' [Laravel 8]

lily :

I have issues with the php error when I tried to insert data for admin using the tinker. I'm creating a multi authentication user which is one for user and one for admin.

PHP Error: Class 'Illuminate/Foundation/Auth/Admin' not found in c:/S/htdocs/i-V/app/Models/Admin.php on line 13

How do I resolve that error?

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',
    ];
} 

enter image description here

I have tried to remove the composer.lock file then install it again also I have done this.

composer dump-autoload
composer install --no-scripts
composer update
Kamlesh Paul :

Change this

use Illuminate\Foundation\Auth\Admin as Authenticatable;

to

use Illuminate\Foundation\Auth\User as Authenticatable;

as Illuminate\Foundation\Auth\User it is core code from laravel core and it don't have Admin class

Este artigo é coletado da Internet.

Se houver alguma infração, entre em [email protected] Delete.

editar em
0

deixe-me dizer algumas palavras

0comentários
loginDepois de participar da revisão

Artigos relacionados

TOP lista

quentelabel

Arquivo