Download the PHP package jefremassingue/spatie-permission-generate without Composer
On this page you can find all versions of the php package jefremassingue/spatie-permission-generate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jefremassingue/spatie-permission-generate
More information about jefremassingue/spatie-permission-generate
Files in jefremassingue/spatie-permission-generate
Package spatie-permission-generate
Short Description Package for genarate permissions
License MIT
Homepage https://github.com/jefremassingue/spatie-permission-generate
Informations about the package spatie-permission-generate
Spatie Permission Generate
Spatie Permission Generate is a package that generates permissions for spatie/laravel-permission based on the directory, controller class name, and methods.
For instance, Admin\UserController with index method => will have the permission admin-user-index
.
Installation
You can install the package via composer:
Usage
Before using the package, you need to install and configure spatie/laravel-permission (https://github.com/spatie/laravel-permission).
Instalation in Laravel
Key | Description | Example |
---|---|---|
SPG_CONTROLLERS_ROOT_PATH | The root path where the controllers are located. You have to use `/` | app/Http/Controllers |
SPG_IGNORE_CLASSES_FILES | The classes that should be ignored (separated by comma). You have to use `\` | 'Controller,Admin\PermissionGeneratorController,Helper\Upload' |
SPG_CONTROLLER_CLASSES_SUFFIX | The suffixes for the controller classes. | '_controller,Controller' |
SPG_IGNORE_METHODS_AND_FUNCTIONS | The methods and functions that should be ignored (separated by comma). | '__construct,pay' |
SPG_DEFAULT_GUARD | The default guard. | 'web' |
Testing
To run the tests, execute the following command:
Example
Consider a file located in /app/Http/Controllers/API/UserController.php
:
The generated permissions would be:
api-user-index
api-user-create
api-user-store
api-user-show
api-user-edit
api-user-update
api-user-destroy
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] or [email protected] instead of using the issue tracker.
Credits
- Jefre Massingue
- Abino Mateve
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate.