PHPackages                             techieni3/laravel-user-permissions - 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. techieni3/laravel-user-permissions

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

techieni3/laravel-user-permissions
==================================

A Laravel package for managing user permissions.

v0.2.0(7mo ago)266MITPHPPHP ^8.4CI failing

Since Nov 27Pushed 3mo agoCompare

[ Source](https://github.com/techieni3/laravel-user-permissions)[ Packagist](https://packagist.org/packages/techieni3/laravel-user-permissions)[ RSS](/packages/techieni3-laravel-user-permissions/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

[![Laravel User Permissions Logo](assets/banner.png)](assets/banner.png)

Laravel User Permissions
========================

[](#laravel-user-permissions)

A Laravel package for managing user roles and permissions. It uses PHP enums for type-safe role definitions and provides a web dashboard for managing access control. Ideally suited for applications that require a robust, easy-to-manage permission system with a visual interface.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Dashboard](#dashboard)
- [Working with Roles](#working-with-roles)
- [Working with Permissions](#working-with-permissions)
- [Laravel Gate Integration](#laravel-gate-integration)
- [Middleware](#middleware)
- [Model Actions](#model-actions)
- [Cascade Deletion](#cascade-deletion)
- [Events](#available-events)
- [Model Discovery Configuration](#model-discovery-configuration)
- [Caching](#caching)
- [Testing](#testing)
- [Similar Packages](#similar-packages)
- [Security](#security)
- [License](#license)

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 12.35.0+

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

[](#installation)

Install the package via Composer:

```
composer require techieni3/laravel-user-permissions
```

Run the installation command to set up the package:

```
php artisan install:permissions
```

This command will:

- Publish the config file to `config/permissions.php`
- Publish migrations to `database/migrations/`
- Publish `Role.php` `ModelActions.php` enums to `app/Enums`
- Add the `HasRoles` trait to your User model

Run the migrations:

```
php artisan migrate
```

Quick Start
-----------

[](#quick-start)

### 1. Define Your Roles

[](#1-define-your-roles)

Edit `app/Enums/Role.php`:

```
