Laravel Permission
Laravel Permission stats
- Downloads
- 35.2M
- Stars
- 11,481
- Open Issues
- 3
- Forks
- 1,727
Permission handling for Laravel 8.0 and up
Laravel Permission Package by Spatie
The Laravel Permission package by Spatie is a powerful tool for handling authorization in Laravel applications, allowing you to manage user permissions and roles through a database effectively.
Key Features
- Ease of Role and Permission Management: Quickly assign permissions directly to users or via roles.
- Integration with Laravel's Gate: All permissions are registered on Laravel's gate, enabling you to check user permissions using Laravel's native
canmethod. - Extensive Documentation: Offers comprehensive documentation that guides through installation and usage.
- Active Maintenance and Community Contribution: Encourages contributions and provides a clear guideline on how to contribute.
Installation and Usage
Install the package via composer:
composer require spatie/laravel-permission
Here's a quick example to get you started:
// Assigning permissions to a user$user->givePermissionTo('edit articles'); // Assigning a role to a user$user->assignRole('writer'); // Checking if a user has a permission$user->can('edit articles');
For detailed installation and usage instructions, check the official documentation.
Support and Contributions
- Community and Support: Spatie encourages sending postcards if their package has helped you, showcasing them on their virtual wall.
- Contributing: Contribution guidelines are provided to help maintain the quality of the package.
- Security Issues: Direct communication via email is advised for any security-related concerns.
Additional Information
- Changelog and Updates: The CHANGELOG is actively maintained, detailing all significant changes.
- License: Distributed under the MIT License, allowing flexibility for personal and commercial use.
This package is inspired by Jeffrey Way’s Laracasts lessons and is recognized for its robustness and ease of use in the Laravel community. Whether you're building a small project or a large-scale application, the Laravel Permission package offers a reliable solution for managing user roles and permissions efficiently.