小编reh*_*han的帖子

在 Laravel 5.6 中未找到特性“App\HasRoles”错误

我尝试通过 laravel 5.6 角色权限系统

当我尝试使用默认身份验证(php artisan make:auth)注册时出现此错误

“Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) Trait 'App\HasRoles' 未找到”

这是我的模型 user.php

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;
    use HasRoles;

    protected $guard_name = 'web'; 

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

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */ …
Run Code Online (Sandbox Code Playgroud)

php permissions roles laravel

7
推荐指数
1
解决办法
7147
查看次数

标签 统计

laravel ×1

permissions ×1

php ×1

roles ×1