PHPackages                             ijodkor/guard - 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. ijodkor/guard

ActiveLibrary

ijodkor/guard
=============

Role, permission and action access control

v0.0.2(12mo ago)034↓100%[1 issues](https://github.com/ijodkor/guard/issues)PHPPHP ^8.0|^8.1|^8.2

Since May 14Pushed 11mo agoCompare

[ Source](https://github.com/ijodkor/guard)[ Packagist](https://packagist.org/packages/ijodkor/guard)[ RSS](/packages/ijodkor-guard/feed)WikiDiscussions main Synced 1mo ago

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

Laravel guard - Access control for state information systems, including RBAC, LBACK, ABAC
=========================================================================================

[](#laravel-guard---access-control-for-state-information-systems-including-rbac-lback-abac)

Role access by level, position and type

### Glossaries

[](#glossaries)

- RBAC - role based access
- LBAC - level based access (republic, province, district &gt; ...)
- ABAC\\RABAC - (Restricted) Action based access

Installation and setup
----------------------

[](#installation-and-setup)

The package will automatically register itself.

Publish migrations

```
php artisan vendor:publish --provider="Ijodkor\Guard\GuardServiceProvider" --tag="guard-migrations"
```

Adjust multischeme for project to service provider

```
AppServiceProvider ...

/**
* Bootstrap any application services.
*/
public function boot(): void {
    $main = database_path('migrations');
    $directories = ['public', 'users', 'rbac'];
    $paths = [];
    foreach ($directories as $directory) {
        $paths[] = database_path('migrations' . DIRECTORY_SEPARATOR . $directory);
    }

    $paths = array_merge([$main], $paths);
    $this->loadMigrationsFrom($paths);
}
```

And define search path of schemas to database.php

```
...
'pgsql' => [
    'driver' => 'pgsql',
    ....
    'search_path' => SchemeList::schemas(),
],
...
```

Run migration

```
php artisan migrate
```

Add seeders to Database seeder in your project

```
class DatabaseSeeder extends Seeder {
    /**
     * Seed the application's database.
     */
    public function run(): void {
        $this->call(UserSeeder::class);
        $this->call(RoleSeeder::class);
    }
}
```

Run database seeder

```
php artisan db:seed
```

### Customize models

[](#customize-models)

Extend user from guard user

```
use Ijodkor\Guard\Models\User as GuardUser;

class User extends GuardUser {

}
...
```

References
----------

[](#references)

### Links

[](#links)

- [HasManyThrough](https://dev.to/mahmudulhsn/laravel-has-many-through-relationship-explained-with-example-22p4)
- [Get route name in middleware](https://laracasts.com/discuss/channels/general-discussion/get-controlller-name-and-action-in-middleware)

Remainder
---------

[](#remainder)

Add extra middleware and use this to customize built-in middleware

[Illuminate Foundation](https://packagist.org/packages/illuminate/foundation) abandoned, so we change use Illuminate\\Foundation\\Auth\\User as Authenticatable in UserModel

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance53

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

360d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6842c2de7e4b7f3b6bfc3ea88684d009d8381f9325bf81c9e9095cf3b0ef84f8?d=identicon)[ijodkor](/maintainers/ijodkor)

---

Top Contributors

[![atezkor](https://avatars.githubusercontent.com/u/58693223?v=4)](https://github.com/atezkor "atezkor (6 commits)")

---

Tags

phplaravelaccesspermissionactionrolelevel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ijodkor-guard/health.svg)

```
[![Health](https://phpackages.com/badges/ijodkor-guard/health.svg)](https://phpackages.com/packages/ijodkor-guard)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[outerweb/image-library

Store and link files to your models

1113.0k2](/packages/outerweb-image-library)[wnikk/laravel-access-rules

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.6k1](/packages/wnikk-laravel-access-rules)

PHPackages © 2026

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