使用entrust权限组件时,Class 'App\Role' not found错误提示解决方法

Laravel Laravel 2259      收藏
使用entrust权限组件时,Class 'App\Role' not found错误提示解决方法

自学php博客

使用entrust权限组件时,Class 'App\Role' not found错误提示,是因为在使用该组件时,重新创建了新的Models文件夹来存放Role.php的model文件,而在生成entrust.php配置文件时,生成的

'role' => 'App\Role',在config/entrust.php文件的22行
所以在项目运行时,无法找到对应的model文件,报出了此错误提示,需要做如下修改
'role' => 'App\Models\Role'。