New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

mibo/px

PHP Library for Permissions [RBAC]
12,128
Install
composer require mibo/px
Latest Version:1.1.8
PHP:^8.2
Laravel:10 – 13
Older releases:9
License:MIT
Last Updated:Jun 22, 2026
Links: GitHub  ·  Packagist
Maintainer: MiBo

PX

codecov

Permissions and their evaluating. Role Based System.

Implementation

composer require mibo/px

Requirements

  • PHP ^8.0
  • illuminate/support ^10.0-^12.0

Usage

// Load the user that has permissions.
/** @var \MiBo\PX\Contracts\HasPermissionsInterface $user */
$user;

if ($user->hasPermission("my.own.permission")) {
    // Do some action
} else {
    // You may log that the user is missing required permission.
}

When implementing the interface, consider to use provided trait. If doing so, call registerPermissions method with all available permissions for the user:

class MyUser implements \MiBo\PX\Contracts\HasPermissionsInterface
{
    use \MiBo\PX\Contracts\HasPermissionsTrait;
    
    public function __construct()
    {
        $this->registerPermissions(
            [
                "my.own.permission",
                "my.another.permission"
            ]
        );
    }
}

Related Packages

nigam214/rbac

Powerful RBAC package for Laravel 5.5 through 11.x

2,017 1
adexaja/rbac

Powerful RBAC package for Laravel 5.1

40 0
ems/permit

Permission based authentication system

8,852 0
visualappeal/laravel-rbac

Role based access control for Laravel 5

17,642 0
artisanpack-ui/rbac

Role-based access control for Laravel — roles with hierarchy, permissions, Blade...

5,769 0

Version History

Version Released PHP Laravel License
1.1.8 ^8.2 ^13.0|^12.0|^11.0|^10.0 MIT
1.1.7 ^8.2 ^12.0|^11.0|^10.0 MIT
1.1.6 ^8.2 ^11.0|^10.0 MIT
1.1.5 ^8.1 ^10.0 MIT
1.1.4 ^8.1 ^10.0