macsidigital/laravel-assignee

This package is abandoned and no longer maintained. The author suggests using the https://github.com/MacsiDigital/laravel-roles package instead.

Role handling for Laravel

1.2.1 2021-02-02 14:08 UTC

This package is auto-updated.

Last update: 2021-04-23 12:39:17 UTC


README

Associate users with roles

Header Image

tests badge version badge downloads badge

This package allows you to manage and assign user roles.

Support us

We invest a lot in creating open source packages, and would be grateful for a sponsor if you make money from your product that uses them.

Installation

This package can be used in Laravel 6.0 or higher.

You can install the package via composer:

composer require macsidigital/laravel-roles

You can either publish the migration and config files separatly or use our helpful install command

The install function

php artisan roles:install

You must publish the migration with:

php artisan vendor:publish --tag="roles-migrations"

After the migration has been published you can create the db tables by running the migrations:

php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="roles-config"

Usage

Once installed you can do stuff like this:

$user->assignRole('writer');

$user->hasRole('writer');

$user->removeRole('writer');

Every guard will have its own set of roles that can be assigned to the guard's users.

Testing

composer test

Todos

[] Build out some proper documentation

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email info@macsi.co.uk instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.