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(10mo ago)034↓100%[1 issues](https://github.com/ijodkor/guard/issues)PHPPHP ^8.0|^8.1|^8.2

Since May 14Pushed 10mo agoCompare

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

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 62% of packages

Maintenance54

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

315d 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

[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.

5358.7k](/packages/io238-laravel-iso-countries)[konekt/acl

Concord Module for Permission handling (Laravel 10 - 12)

1070.1k1](/packages/konekt-acl)

PHPackages © 2026

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