且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQLSTATE [42S02]:找不到基表或视图:1146表'prj_roocket.permissions'不存在

更新时间:2023-11-17 17:55:16

此错误是由 AuthServiceProvider 中的函数 getPermissions 给出的(或者您定义了身份验证服务的其他地方)提供者).

This error is given by the function getPermissions in AuthServiceProvider (or somewhere else you defined your authentication service provider).

可能您的函数如下所示:

Probabily your function looks like this:

protected function getPermissions()
{
    return Permission::with('roles')->get();
}

尝试将功能 getPermissions 替换为:

protected function getPermissions()
{
    try {
        return Permission::with('roles')->get();
    } catch (\Exception $e) {
        return [];
    }
}

,然后再次运行 php artisan migration .

注意:有了此修复程序,您将不会损害系统安全性.

Note: with this fix you are not going to compromise the system security.