nonetallt / laravel-permission-blueprints by nonetallt

Update spatie/laravel-permission package database roles and permissions easily using json blueprints.
11
0
1
Package Data
Maintainer Username: nonetallt
Maintainer Contact: jyri.mikkola@pp.inet.fi (Jyri Mikkola)
Package Create Date: 2019-09-05
Package Last Update: 2019-12-03
Language: PHP
License: MIT
Last Refreshed: 2024-12-15 15:21:05
Package Statistics
Total Downloads: 11
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 2

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