New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

nonetallt/laravel-permission-blueprints

Update spatie/laravel-permission package database roles and permissions easily using json blueprints.
11
Install
composer require nonetallt/laravel-permission-blueprints:dev-master
License:MIT
Last Updated:Dec 3, 2019
Links: GitHub  ·  Packagist
Maintainer: nonetallt

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

Related Packages

spatie/valuestore

Easily store some values

1,345,391 763
cgross/laraguard

Permissions/roles for Laravel 5

9,536 38
spatie/laravel-valuestore

Easily store some values

1,341 763
panoscape/access

Role and Permission control for Laravel

18 1
crcms/permission

The Permission Packages .

1,542 0