PHPackages                             gopex/laratrust-permission-creator - 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. gopex/laratrust-permission-creator

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

gopex/laratrust-permission-creator
==================================

0.1.0(2y ago)06GPL3PHP

Since Jan 28Pushed 1y agoCompare

[ Source](https://github.com/gopex-team/LaratrustPermissionCreator)[ Packagist](https://packagist.org/packages/gopex/laratrust-permission-creator)[ RSS](/packages/gopex-laratrust-permission-creator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

LaratrustPermissionCreator
==========================

[](#laratrustpermissioncreator)

LaratrustPermissionCreator is a Laravel package that facilitates the management of roles and permissions in your application. It provides two artisan commands, `laratrust:from-config` and `laratrust:from-db`, to read and synchronize roles and permissions either from configuration files or directly from the database.

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

[](#installation)

Install the package using Composer:

```
composer require your-vendor/laratrust-permission-creator
```

Once installed, run the migrations to set up the necessary database tables:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Laratrust:from-config

[](#laratrustfrom-config)

The `laratrust:from-config` command reads roles and permissions from configuration files located in the `laratrust` folder at the root of your project. To create or update permissions, you can add new PHP files in the following format:

#### Example File: BasicRolePermissions.php

[](#example-file-basicrolepermissionsphp)

```
return [
    "permissions" => [
        "tour_create" => [
            "display_name" => "ساخت تور"
        ],
        "tour_edit" => [
            "display_name" => "به روز رسانی تور"
        ],
    ],
    "roles" => [
        "basic" => [
            "display_name" => "پایه",
            "description" => "این رول را همه کاربران دارند"
        ],
        "admin" => [
            "display_name" => "ادمین",
            "description" => "مخصوص ادمین کل"
        ],
        "supervisor" => [
            "display_name" => "سرپرست",
            "description" => "سرپرست اصلی تور"
        ]
    ],
    "rolesPermissions" => [
        "admin" => [
            "tour_create",
            "tour_update",
            "tour_show",
            "tour_list",
            "tour_delete",
        ],
        "supervisor" => [
            "tour_create",
            "tour_update",
            "tour_show",
            "tour_list",
            "tour_delete",
        ]
    ]
];
```

To execute the command:

```
php artisan laratrust:from-config
```

This will create or update the roles and permissions based on the provided configuration files.

### Laratrust:from-db

[](#laratrustfrom-db)

The `laratrust:from-db` command reads roles and permissions directly from the database and updates the configuration files in the `laratrust` folder accordingly.

```
php artisan laratrust:from-db
```

This command ensures that your configuration files stay in sync with the current state of roles and permissions stored in the database.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE). Feel free to use, modify, and distribute as needed.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% 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

Unknown

Total

1

Last Release

834d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5d4cf3029cf6d45bb33d0391d6bc02c0831146abad5dcf624fe1ec0cc09aeda?d=identicon)[gopex](/maintainers/gopex)

---

Top Contributors

[![foroughi1380](https://avatars.githubusercontent.com/u/55579143?v=4)](https://github.com/foroughi1380 "foroughi1380 (7 commits)")[![erfanrhb](https://avatars.githubusercontent.com/u/60898556?v=4)](https://github.com/erfanrhb "erfanrhb (1 commits)")

### Embed Badge

![Health badge](/badges/gopex-laratrust-permission-creator/health.svg)

```
[![Health](https://phpackages.com/badges/gopex-laratrust-permission-creator/health.svg)](https://phpackages.com/packages/gopex-laratrust-permission-creator)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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