mibo/px

PHP Library for Permissions [RBAC]
11,754
Install
composer require mibo/px
Latest Version:1.1.8
PHP:^8.2
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

offload-project/laravel-mandate

Unified authorization management for Laravel - roles, permissions, and feature f...

2,275 7
addons/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

107 0
shiwuhao/laravel-rbac

A modern Laravel 12+ RBAC package with data permissions and auto-sync features.

1,931 1
santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

6,170,887 2,274
nigam214/rbac

Powerful RBAC package for Laravel 5.5 through 11.x

1,802 1