laravel-simple-permissions maintained by pedrazadixon
Description
A simple package to manage permissions in Laravel
Author
Last update
2023/08/10 03:19
(dev-main)
License
Downloads
33
Laravel Simple Permissions
Laravel Simple Permissions is a lightweight library designed to simplify permissions management in Laravel projects.
Features
- Easily integrate permissions into your Laravel application.
- Assign and validate permissions on users.
- Supports Laravel's built-in user authentication system.
Requirements
- PHP >= 7.3
- Laravel >= 8.0
- Laravel Breeze (Laravel's authentication features)
Installation
Laravel Simple Permissions works with Laravel's authentication features. Please install this before install Laravel Simple Permissions. You can follow instructions here: https://laravel.com/docs/10.x/starter-kits#laravel-breeze
You can install the package via composer:
composer require pedrazadixon/laravel-simple-permissions
Finish the installation with the following command:
php artisan laravel-simple-permissions:install
Usage
Add permissions middleware to routes, for example:
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified', 'permissions'])->name('dashboard');
Creating permissions
You can create permissions navigate the following route:
Publish views (optional)
You can publish the views with:
php artisan vendor:publish --tag=laravel-simple-permissions-views