Looking to hire Laravel developers? Try LaraJobs

laravel-permission-blueprints maintained by nonetallt

Description
Update spatie/laravel-permission package database roles and permissions easily using json blueprints.
Author
Last update
2019/12/03 07:23 (dev-dependabot/composer/symfony/http-foundation-4.4.1)
License
Links
Downloads
11

Comments
comments powered by Disqus

laravel-permission-blueprints

Create json blueprints for your application roles and permissions to easily update permissions without having to run manual modifications or multiple seeders for your database. Built to be used with spatie/laravel-permission laravel package.

Permissions

Create your permission json blueprint and set the path in config.

[
    "permission-1",
    "permission-2",
    "permission-3",
    "permission-4"
]

Update permissions using this command. Old permissions are removed and new ones are added.

php artisan permissions:update

Roles

Create your role json blueprint and set the path in config.

[
    {
        "name": "superadmin",
        "permissions": "all"
    },
    {
        "name": "admin",
        "permissions": [
            "permission-1",
            "permission-2",
            "permission-3"
        ]
    },
    {
        "name": "user",
        "permissions": [
            "permission-1"
        ]
    }
]

Update roles using this command. Old roles are removed and new ones are added. Additionally, permissions for each role are updated. This command also updates permissions first to make sure they exist before attempting to attach any permissions for roles.

php artisan roles:update