Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 33 | All time: 11,097 This week: 455![]() |
Version | License | PHP version | Categories | |||
laravel-urp 1.0.0 | Custom (specified... | 5 | PHP 5, User Management, Libraries |
Description | Author | ||||||||
This package can manage the user roles in Laravel applications. |
|
URP stands for user role permissions. A basic package for kickstarting laravel project that contain multiple user roles and permission.
URP requires Laravel 5.3+ to run.
Install using composer
on fresh laravel project.
composer require agoussec/urp
Creating User role
php artisan role:add {rolename} {slug?}
Listing all added user roles
php artisan role:list
Assign role to user
php artisan assign:role {roleslug} {usermail}
Create permission
php artisan permission:add {permissionname} {slug?}
Listing all added permissions
php artisan permission:list
Migration file will atoumatically load after installation of package. just need to run migrate
cammand.
php artisan migrate
RoleMiddleware
// In Route
Route::get('test/middleware', [TestController::class, 'testShow'])->name('test.role')->middleware('role:role1|role2,permission');
can
if($request->user()->can('create-tasks')) {
//Code goes here
}
role
$user->hasRole('developer')
permission
$user->givePermissionsTo('create-tasks')
Role
@role('developer')
Hello developer
@endrole
can
@can('add-course')
<li class="nav-item"><a href="{{ route('admin.course.add') }}" class="nav-link">Add New Course</a></li>
@endcan
@canany(['view-course', 'edit-course', 'delete-course'])
<li class="nav-item "><a href="{{ route('admin.course.manage') }}" class="nav-link">Manage Courses</a></li>
@endcanany
MIT
Free Software, Hell Yeah!
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.