PHPackages                             agoussec/urp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. agoussec/urp

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

agoussec/urp
============

A laravel package for kickstarting user role and permission project

2321PHP

Since Nov 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/agoussec/urp)[ Packagist](https://packagist.org/packages/agoussec/urp)[ RSS](/packages/agoussec-urp/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

URP
===

[](#urp)

A laravel package for kickstarting user role and permission project
-------------------------------------------------------------------

[](#a-laravel-package-for-kickstarting-user-role-and-permission-project)

**URP** stands for user role permissions. A basic package for kickstarting laravel project that contain multiple user roles and permission.

Features
--------

[](#features)

- Publishable role and permission migrations
- Create user `roles` and `permissions` using artisan command line
- Assign `roles` and `permissions` to user from artisan command
- Role &amp; Permission middleware
- Check `$user->hasPermissionTo`
- Check `$user->hasRole`
- Blade `@can`, `@cannot` directive

Installation
------------

[](#installation)

URP requires [Laravel](https://laravel.com/) 5.3+ to run.

Install using `composer` on fresh laravel project.

```
composer require agoussec/urp
```

Add HasPermission trait in User Model.

```
name('test.role')->middleware('role:role1|role2,permission');

```

### Controller

[](#controller)

`can`

```
if($request->user()->can('create-tasks')) {
    //Code goes here
}

```

`role`

```
$user->hasRole('developer')

```

`permission`

```
$user->givePermissionsTo('create-tasks')

```

### Blade directive

[](#blade-directive)

`Role`

```
@role('developer')
    Hello developer
@endrole

```

`can`

```
@can('add-course')
    Add New Course
@endcan

@canany(['view-course', 'edit-course', 'delete-course'])
    Manage Courses
@endcanany

```

TODOs
-----

[](#todos)

- Console commands for removing `roles`, `permissions`
- Commands for giving `permission` to specific user or user `role`
- Policies logic around a particular model or resource.
- Test cases

Credits
-------

[](#credits)

- [laravelcode](https://www.laravelcode.com/post/laravel-7-user-roles-and-permissions-tutorial-without-packages)

License
-------

[](#license)

MIT

**Free Software, Hell Yeah!**

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/44767182af477decbc52e69a70c631585d6fe1772cb02e551e55bd64a5eb242a?d=identicon)[agoussec](/maintainers/agoussec)

---

Top Contributors

[![agoussec](https://avatars.githubusercontent.com/u/16516713?v=4)](https://github.com/agoussec "agoussec (13 commits)")

---

Tags

easy-to-installeasy-to-understandeasy-to-uselaravellaravel-packagepermissionsrolestraitsuseruser-role-based-operationsuser-role-permission

### Embed Badge

![Health badge](/badges/agoussec-urp/health.svg)

```
[![Health](https://phpackages.com/badges/agoussec-urp/health.svg)](https://phpackages.com/packages/agoussec-urp)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
