uteq/laravel-move-permissions

Permissions for Laravel Move Admin Panel

v0.3.0 2022-01-05 11:48 UTC

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package is still in development and does not have a test suite.

Permissions for Laravel Move enables you to create grouped permissions and is a wrapper for Spaties Laravel Permission. This package was heavily inspired by this package https://github.com/eminiarts/nova-permissions, by eminiarts.

Support us

The best way to support us is by adding a test suite to this project and help build, give feedback and extend it :)

Installation

You can install the package via composer:

composer require uteq/laravel-move-permissions

You can publish and run the migrations with:

php artisan vendor:publish --provider="Uteq\MovePermissions\PermissionsServiceProvider" --tag="migrations"
php artisan migrate

You can publish the seeders with:

php artisan vendor:publish --provider="Uteq\MovePermissions\PermissionsServiceProvider" --tag="seeders"

You can publish the config file with:

php artisan vendor:publish --provider="Uteq\MovePermissions\PermissionsServiceProvider" --tag="config"

Usage

Add one of the following (or all) to your User Resource:

use Uteq\MovePermissions\Fields\Role;
use Uteq\MovePermissions\Fields\Roles;
use Uteq\MovePermissions\Fields\Permissions;

public function fields()
{
    // Add a single role to your user
    Role::make('Rol', 'role'),

    // Add more than one role to your user
    Roles::make('Roles', 'roles'),

    // Add permissions to your user
    Permissions::make('Permissions', 'permissions'),
}

You are free to combine the Role/Roles and Permissions. Don't use the Role and Roles Field on the same Resource. Make sure you add a Policy for the User to make Permissions policy work.

Add the Role Resource to your Move folder

<?php

namespace App\Admin\Users;

class Role extends \Uteq\MovePermissions\Resources\Role
{

}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.