PHPackages                             stt196/laravel-privilege-manager - 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. stt196/laravel-privilege-manager

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

stt196/laravel-privilege-manager
================================

A robust, security-hardened, and performance-optimized privilege/permission management system for Laravel applications with menu-based access control.

v1.0.1(1mo ago)00MITPHPPHP ^8.1CI passing

Since Apr 30Pushed 1mo agoCompare

[ Source](https://github.com/STT196/laravel-privilege-manager)[ Packagist](https://packagist.org/packages/stt196/laravel-privilege-manager)[ Docs](https://github.com/STT196/laravel-privilege-manager)[ RSS](/packages/stt196-laravel-privilege-manager/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Laravel Privilege Manager
=========================

[](#laravel-privilege-manager)

A robust, security-hardened, and performance-optimized privilege/permission management system for Laravel applications. Built for production use with enterprise-grade security and performance features.

Features
--------

[](#features)

✅ **Menu-Based Access Control** - Control access at the menu level with granular actions
✅ **Security Hardened** - Rate limiting, input validation, logging, and injection prevention
✅ **Performance Optimized** - Multi-level caching, batch operations, and query optimization
✅ **Easy Integration** - Drop-in package for existing Laravel apps
✅ **Flexible Authorization** - Middleware, helpers, contracts, and manual checks
✅ **Production Ready** - Thoroughly tested and documented

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require stt196/laravel-privilege-manager
```

### Manual Install from GitHub

[](#manual-install-from-github)

If the package is not on Packagist yet, you can install it directly from GitHub using Composer VCS repositories:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/STT196/laravel-privilege-manager.git"
        }
    ],
    "require": {
        "stt196/laravel-privilege-manager": "dev-main"
    }
}
```

Then run:

```
composer update
```

### Fresh Laravel Projects

[](#fresh-laravel-projects)

If you're starting from a brand-new Laravel app, run the package installer and then migrate:

```
php artisan privilege-manager:install
php artisan migrate
```

Then add the reusable trait to your `App\Models\User` model:

```
use LaravelPrivilegeManager\Traits\HasPrivileges;

class User extends Authenticatable
{
    use HasPrivileges;
}
```

### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --provider="LaravelPrivilegeManager\Providers\PrivilegeManagerServiceProvider" --tag="privilege-manager-config"
```

This creates `config/privilege-manager.php` where you can customize behavior.

### 3. Update Your User Model

[](#3-update-your-user-model)

Your User model must implement the `PrivilegeUserContract` interface, or you can use the `HasPrivileges` trait shown above:

```
