Download the PHP package almas/laravel-permission without Composer
On this page you can find all versions of the php package almas/laravel-permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download almas/laravel-permission
More information about almas/laravel-permission
Files in almas/laravel-permission
Package laravel-permission
Short Description A dynamic role and permission system designed to reduce development time.
License MIT
Homepage https://github.com/almas/permission
Informations about the package laravel-permission
A dynamic role and permission system designed to reduce development time. Fully compatible with Laravel Livewire. Support for React and other stacks is in progress.
Installation
You can install the package via Composer:
Set Super Admin Set the Super Admin email in your .env file:
- If not defined, the default is [email protected].
- A random password is automatically generated for the Super Admin.
- You can reset the password via the "Forgot Password" option
After installation, run the following Artisan command to set up everything:
This command will:
- Run necessary database migrations
- Seed default roles and permissions automatically
No additional setup is required — you're ready to go!
Publish Configuration File
To publish the configuration file for this package, run the following command:
Super Admin Features
- Only the Super Admin can create and delete permissions.
- For every new permission added to the system, the Super Admin is automatically granted that permission.
Route Registration
Add the following line to your routes/web.php file:
- By default, all routes will be protected using the auth middleware.
- This will automatically register all necessary permission management routes.
Route Prefix Behavior
-
When using Route::permission();, the base route will be:
-
You can customize the base route prefix by passing a parameter to the Route::permission() method:
- This will change the base route to:
Blade Helper to Get Base Permission URL
Usage
-
Get All Permissions (as array):
-
Check a Single Permission: (eg. true/false):
- Blade Directives:
License
The MIT License (MIT). Please see License File for more information.