Download the PHP package holoultek/laravel-capabilities without Composer
On this page you can find all versions of the php package holoultek/laravel-capabilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download holoultek/laravel-capabilities
More information about holoultek/laravel-capabilities
Files in holoultek/laravel-capabilities
Package laravel-capabilities
Short Description Laravel package to add roles and capabilities functionality for your project
License MIT
Informations about the package laravel-capabilities
Laravel Capabilities
A laravel package to add roles and capabilities functionality to your auth models.
Installation
To use the package:
Uuid Auth models
If you are using uuid instead of the normal integer id for your auth models, you should publish the migrations and update the columns.
Migrate the database
Then you have to publish the config files for roles and capabilities
This will publish 2 files:
1. capabilities.php
The capabilities are auto discovered via this config files; The key will be your controller name without 'Controller' word.
And the values will be an indexed array which describe the capability name as index and the methods in your controller as array for the value.
For Example:
This describes a "show dashboard" capability which controlled by "DashboardController", the "show" method
2. roles.php
You can provide here all the roles for your application as keys and its value will be a list of all capabilities defined in the previous step.
'capability' is the middleware.
As a final step you should add the access controlled middleware to your route
or as group
Fill the tables
After editing the config files you can run these commands in sequence to create all roles and capabilities defined
Attaching and detaching
To attach or detach a capability
To attach or detach a capability
To check if auth model has a capability or role
Badges
Contact
If you have any questions or concerns, feel free to reach out to me at [email protected]
Or by visiting https://holoultek.com