PHPackages                             litepie/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. litepie/roles

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

litepie/roles
=============

A Laravel package for role management system

v1.0.2(6mo ago)071MITPHPPHP ^8.2|^8.3CI failing

Since Oct 2Pushed 6mo agoCompare

[ Source](https://github.com/Litepie/Roles)[ Packagist](https://packagist.org/packages/litepie/roles)[ RSS](/packages/litepie-roles/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (4)Used By (1)

Laravel Roles Package
=====================

[](#laravel-roles-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c92feaba1e9c5b074488b5eab1dac46e6d31afa811a7357a0e22307ad1fe8b55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6974657069652f726f6c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/roles)[![GitHub Tests Action Status](https://camo.githubusercontent.com/32b7a770f58e303c7562e19f8b011ec2717abed9897b9d0eb190bd6b42b397f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c6974657069652f726f6c65732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/litepie/roles/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/176f01e0726c6dfd39a00df5d98f3e1e48bd59b2271a0d7fbac6e3b44e64cf0f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c6974657069652f726f6c65732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/litepie/roles/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3aad00c66a373b1f91cb723bdefd2ec9971b6db274c1e7bc0c592ea31057c6c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6974657069652f726f6c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/roles)

A Laravel package for role management system, focusing on role-based access control. This package is extracted and inspired by the role functionality from Spatie's Laravel Permission package, providing a lightweight and focused solution for role management.

Features
--------

[](#features)

- Create and manage roles
- Assign roles to users
- Check user roles with various methods
- Role-based middleware
- Artisan commands for role management
- Blade directives for role checks
- Event system for role operations
- Support for multiple guards
- Enum support for roles
- Caching for performance

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

[](#installation)

You can install the package via composer:

```
composer require litepie/roles
```

You can publish and run the migrations with:

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

You can publish the config file with:

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

This is the contents of the published config file:

```
