Download the PHP package inoplate/abilities without Composer
On this page you can find all versions of the php package inoplate/abilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inoplate/abilities
More information about inoplate/abilities
Files in inoplate/abilities
Package abilities
Short Description A laravel package to manage user abilities
License MIT
Informations about the package abilities
Inoplate abilities loader
Inoplate abilities loader is a laravel package to load and check abilities from database.
Instalation
composer install inoplate/abilities
Usage
Before we can use this package, we must follow several step below.
- Add Inoplate\Abilities\AbilitiesServiceProvider to our providers configuration.
- Replate providers for Illuminate\Auth\AuthServiceProvider with Inoplate\Abilities\AuthServiceProvider
To register abilities, we can extend BootstrapServiceProvider that shipped with this package. Define availabe abilities in the getAbilities method
This package shipped with default migrations. You can publish and use it or use something else based with what you need. This package also shipped with User and Role model that has abilities property. And again you are free to use it or not. (User an Role are N:N in relationship)
Every time we check ability like $user->can('create-post') or Gate::allows('create-post'), it will check the abilities that belongs to User.
Policy is a resource based check, we can use it as usual.
Please Note.
- If you use custom Gate checker, there will be one additional parameters that is ability to check.
Running the tests
vendor/bin/phpunit
Contribution
Thank you for considering contributing to the this package. Just create pull request to and elaborate your purpose. We can discuss about the coding standart, branching strategy, etc.
License
This project is licensed under the MIT License