PHPackages                             owowagency/laravel-has-users-with-roles - 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. owowagency/laravel-has-users-with-roles

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

owowagency/laravel-has-users-with-roles
=======================================

A trait for Laravel models which have many users with roles.

v2.1.0(3y ago)08.9k1[1 issues](https://github.com/owowagency/laravel-has-users-with-roles/issues)MITPHPCI failing

Since Dec 18Pushed 3y agoCompare

[ Source](https://github.com/owowagency/laravel-has-users-with-roles)[ Packagist](https://packagist.org/packages/owowagency/laravel-has-users-with-roles)[ RSS](/packages/owowagency-laravel-has-users-with-roles/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (9)Used By (0)

Laravel: Has Users With Roles Trait
===================================

[](#laravel-has-users-with-roles-trait)

A trait for Laravel models which have many users with roles.

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

[](#installation)

Via Composer in an already running project:

```
$ composer require owowagency/laravel-has-users-with-roles
$ composer update
```

Usage
-----

[](#usage)

1. Implement the trait in the model which will have many users with roles.
2. \*Override the `getUsersPivotClass` method to return the desired pivot model class. By default it returns `Pivot::class`.
3. \*Configure the `user_model_path` config value to tell the trait where the `User` model is. By default the path is `App\Models\User`.

\* = Optional

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 52.6% 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.

###  Release Activity

Cadence

Every ~195 days

Recently: every ~247 days

Total

7

Last Release

1166d ago

Major Versions

1.2.0 → v2.0.02022-06-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b0064d818f9593dfb4f9d86217bbf5f14961ad6779b84fd5546dd91f296d898?d=identicon)[dees040](/maintainers/dees040)

---

Top Contributors

[![albertpratomo](https://avatars.githubusercontent.com/u/25815584?v=4)](https://github.com/albertpratomo "albertpratomo (10 commits)")[![dees040](https://avatars.githubusercontent.com/u/5390555?v=4)](https://github.com/dees040 "dees040 (4 commits)")[![thomasowow](https://avatars.githubusercontent.com/u/45201651?v=4)](https://github.com/thomasowow "thomasowow (4 commits)")[![YouneselBarnoussi](https://avatars.githubusercontent.com/u/16510310?v=4)](https://github.com/YouneselBarnoussi "YouneselBarnoussi (1 commits)")

---

Tags

laravelrolestraitsHas users

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/owowagency-laravel-has-users-with-roles/health.svg)

```
[![Health](https://phpackages.com/badges/owowagency-laravel-has-users-with-roles/health.svg)](https://phpackages.com/packages/owowagency-laravel-has-users-with-roles)
```

###  Alternatives

[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeremykenedy/laravel-roles

A Powerful package for handling roles and permissions in Laravel. Supports Laravel 5.3 up to 12.

1.0k826.8k7](/packages/jeremykenedy-laravel-roles)[chiiya/filament-access-control

Admin user, role and permission management for Laravel Filament

21847.2k](/packages/chiiya-filament-access-control)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)

PHPackages © 2026

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