ijodkor/guard

There is no license information available for the latest version (v0.0.2) of this package.

Role, permission and action access control

v0.0.2 2025-05-14 09:26 UTC

This package is not auto-updated.

Last update: 2025-05-15 07:51:56 UTC


README

Role access by level, position and type

Glossaries

  • RBAC - role based access
  • LBAC - level based access (republic, province, district > ...)
  • ABAC\RABAC - (Restricted) Action based access

Installation and setup

The package will automatically register itself.

Publish migrations

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

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

Extend user from guard user

use Ijodkor\Guard\Models\User as GuardUser;

class User extends GuardUser {

}

...

References

Links

Remainder

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

Illuminate Foundation abandoned, so we change use Illuminate\Foundation\Auth\User as Authenticatable in UserModel