PHPackages                             mouhamedfd/permissions-generator - 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. mouhamedfd/permissions-generator

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

mouhamedfd/permissions-generator
================================

:permission generation for all your declared routes with corresponding controller action

1.0.5(9mo ago)4411MITPHPCI passing

Since Oct 1Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/mouhamedfd/permissions-generator)[ Packagist](https://packagist.org/packages/mouhamedfd/permissions-generator)[ Docs](https://github.com/mouhamedfd/permissions-generator)[ RSS](/packages/mouhamedfd-permissions-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (8)Used By (0)

Laravel Permissions Generator
=============================

[](#laravel-permissions-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5e18d744234fd2f14dbdd6890867873a16761392697458bc64829c3cf41899a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f7568616d656466642f7065726d697373696f6e732d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mouhamedfd/permissions-generator)[![Total Downloads](https://camo.githubusercontent.com/9f51f87093c208e8c78950599855b7fc5593f344295a7cbd59c572fb63582dba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f7568616d656466642f7065726d697373696f6e732d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mouhamedfd/permissions-generator)[![Build Status](https://github.com/issafy/permissions-generator/actions/workflows/php.yml/badge.svg)](https://github.com/issafy/permissions-generator/actions/workflows/php.yml/badge.svg)[![StyleCI](https://camo.githubusercontent.com/9422e92fcaa4e903828ab41c3cdfc3c0cc9e737b8e035731db1835dbfbb047e0/68747470733a2f2f7374796c6563692e696f2f7265706f732f3431323238303538362f736869656c64)](https://styleci.io/repos/412280586)

This package add some artisan command to help generating permissions for your declared routes.

For the permissions management this package use [Laravel-permission](https://github.com/spatie/laravel-permission/tree/main) by [Spatie](https://spatie.be/docs/laravel-permission/v5/introduction)

### Usage

[](#usage)

Each of your routes that you want to add permission should have an alias (name) seperated by dot(.) for exemple:

```
Route::get('/posts/special_action',[App\Http\Controllers\PostController::class, 'specialaction'])->name('posts.specialaction');
Route::get('/posts/another_action',[App\Http\Controllers\PostController::class, 'anotheraction'])->name('posts.anotheraction');
```

In this example permissions will be generated for the PostController linked to the **specialaction** and **anotheraction**

```
public function __construct()//#
{
    $this->middleware('auth');
    $this->middleware(['permission:posts.specialaction'])->only(['specialaction']);
    $this->middleware(['permission:posts.anotheraction'])->only(['anotheraction']);

 }//#
```

Take a look at [contributing.md](contributing.md) to see a to do list.

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

[](#installation)

Via Composer

```
$ composer require mouhamedfd/permissions-generator
```

### Publish configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=permissions-generator.config
```

The default configuration exclude some keywords and some columns, it's also possible to add some middlewares

```
return [
    'excluded_keywords'=>[
        'Auth',
        'Translation',
    ],
    'have_resource_column'=>false,
    'have_description_column'=>false,
    'middlewares'=>[
        'auth',
    ],

];
```

Usage
-----

[](#usage-1)

Simulation mode

```
php artisan permission:generate
```

Database mode

```
php artisan permission:generate --action=database
```

Insertion to controllers

```
php artisan permission:generate --action=controllers
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing [PHPUnit](https://phpunit.de/)
--------------------------------------

[](#testing-phpunit)

```
git clone https://github.com/mouhamedfd/permissions-generator.git
composer install
cp vendor/spatie/laravel-permission/config/permission.php vendor/orchestra/testbench-core/laravel/config/permission.php
vendor/bin/testbench cache:clear
vendor/bin/testbench config:clear
composer exec phpunit [or vendor/bin/phpunit]
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Credits
-------

[](#credits)

- [Mouhamed Fadel Diagana](https://github.com/mouhamedfd)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance57

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~279 days

Recently: every ~349 days

Total

6

Last Release

285d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d8c203336da965b7b114df06fba7568b66cc7318ec12515d5e314d8bbecbe3a?d=identicon)[Mouhamed Fadel DIAGANA](/maintainers/Mouhamed%20Fadel%20DIAGANA)

---

Top Contributors

[![issafy](https://avatars.githubusercontent.com/u/60886715?v=4)](https://github.com/issafy "issafy (45 commits)")[![mouhamedfd](https://avatars.githubusercontent.com/u/21093800?v=4)](https://github.com/mouhamedfd "mouhamedfd (30 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

laravelsecuritygeneratorauthorizationpermissions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mouhamedfd-permissions-generator/health.svg)

```
[![Health](https://phpackages.com/badges/mouhamedfd-permissions-generator/health.svg)](https://phpackages.com/packages/mouhamedfd-permissions-generator)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[shanmuga/laravel-entrust

This package provides a flexible solution to add ACL to Laravel

68312.9k2](/packages/shanmuga-laravel-entrust)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)[beatswitch/lock-laravel

A Laravel Driver for Lock.

15529.1k1](/packages/beatswitch-lock-laravel)[sametsahindogan/laravel-jwtredis

This package allows JWT-authenticated users to be stored and management in Redis with their roles, permissions, statuses and anything you want.

1221.9k](/packages/sametsahindogan-laravel-jwtredis)[phpzen/laravel-rbac

Role based access control for Laravel 5

383.2k](/packages/phpzen-laravel-rbac)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
