New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

owowagency/laravel-has-users-with-roles

A trait for Laravel models which have many users with roles.
8,885
Install
composer require owowagency/laravel-has-users-with-roles
Latest Version:v2.1.0
Laravel:7 – 10
Older releases:5 · 6
License:MIT
Last Updated:Apr 11, 2023
Links: GitHub  ·  Packagist
Maintainer: dees040

Laravel: Has Users With Roles Trait

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

Installation

Via Composer in an already running project:

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

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

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

MIT

Related Packages

codinglabsau/laravel-roles

Simple Laravel roles

95,357 7
eneadm/ladder

Feather light permissions for Laravel.

27,347 263
miracuthbert/laravel-roles

An Eloquent roles and permissions package for Laravel 5.8 and up

1,684 2
codingphase/acl

The package provides a way to add Role-based Permissions to Laravel

136 0
zablose/rap

RaP - Roles and Permissions

76 0

Version History

Version Released Laravel License
v2.1.0 ^7.0|^8.0|^9.0|^10.0 MIT
v2.0.1 ^7.0|^8.0|^9.0 MIT
v2.0.0 ^7.0|^8.0|^9.0 MIT
1.2.0 ^5.0|^6.0|^7.0|^8.0 MIT
1.1.1 ^5.0|^6.0|^7.0 MIT