bluecloud / route-permissions
Laravel route based permission system
Installs: 52
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/bluecloud/route-permissions
Requires
- bluecloud/response-builder: ^v1.3
This package is auto-updated.
Last update: 2025-10-14 19:58:16 UTC
README
Implement route based permissions in your laravel app.
How to Use
composer require bluecloud/route-pemissions
php artisan migrate
-
use
Bluecloud\RoutePermissions\Models\Traits\HasRoutePermissionstrait in yourUsermodel -
Add
role_idcolumn to youruserstable. -
To restrict access to resources based on the routes, wrap the routes to those resources in
Bluecloud\RoutePermissions\Http\Middleware\PermitRoutemiddleware
How it works
Route permissions package introduces roles and permissions to your
application.
Permissions are actual actions a user can do. They are defined by route uri
and http method. Arguably every route of your application should have a
corresponding permission. These permissions can be managed under the
Bluecloud\RoutePermissions\Models\Permission model.
Role are groups of permissions that make up a user's job. A role,
presented by the Bluecloud\RoutePermissions\Models\Role model can have
as many permissions as you would like the user to have.
Every user should belong to a role. A user can or cannot access a resource
based on the permissions the role they belong to have. A user's permission
can be changed by changing their role or by changing the permissions
attached to their role.
Configuration
You can edit the application config by publishing the package's resources
php artisan vendor:publish and choosing Bluecloud\RoutePermissions\RoutePermissionsServiceProvider
from the list