Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permissions:generate fails with backpack 3.4 #43

Open
bauersfeld opened this issue Oct 2, 2018 · 0 comments
Open

permissions:generate fails with backpack 3.4 #43

bauersfeld opened this issue Oct 2, 2018 · 0 comments

Comments

@bauersfeld
Copy link

bauersfeld commented Oct 2, 2018

php artisan permissions:generate is failing on your 0.4 release because Backpack Permissions has upgraded from using spatie/laravel-permission 1.4 to 2.12. laravel-permission now requires guard_name to specified and as results is failing in the method

Novius\Backpack\CRUD\PanelTraitscreatePermissions($permissions)

Here is my suggested fix:

protected function createPermissions($permissions)
    {
        // Add missing permissions to DB
        foreach($permissions as $permission) {
            \Backpack\PermissionManager\app\Models\Permission::create(['name' => $permission]);
        }

        // Forget permissions cache
        app(\Backpack\PermissionManager\app\Models\Permission::class)->forgetCachedPermissions();

        return true;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant