Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Permission Manager Laravel Package

hosseinhezami/laravel-permission-manager

Enterprise-grade Laravel permission manager combining RBAC, ABAC, role hierarchy, multi-tenancy, wildcard and temporary permissions, condition engine, multi-guard support, audit logging, middleware DSL, Blade directives, and Gate/Policy integration.

View on GitHub
Deep Wiki
Context7
v2.0.1

v2.0.1 โ€” Migration Fixes & MySQL Compatibility

This patch release resolves the installation issues reported on v2.0.0, so php artisan migrate now works reliably on MySQL, PostgreSQL and SQLite for fresh installations.

๐Ÿ› What's Fixed

  • Migration dependency order โ€” teams is now created before user_roles and user_permissions, fixing foreign-key failures on MySQL where the referenced table must exist first.
  • MySQL primary-key compatibility โ€” the nullable team_id column is no longer placed inside a composite PRIMARY KEY (rejected by MySQL). user_roles now uses a safe primary key with a UNIQUE(user_id, role_id, team_id) constraint.
  • Deterministic schema โ€” all 14 migrations were renumbered (2026_08_20_000001 โ€ฆ 2026_08_20_000014) and cleaned up so a fresh install always succeeds in the correct order.

๐Ÿ—„๏ธ Schema (14 tables)

roles ยท permission_groups ยท permissions ยท teams ยท role_permissions ยท user_roles ยท user_permissions ยท role_inherits ยท permission_sets ยท permission_set_items ยท team_user ยท permission_conditions ยท permission_audits ยท authorization_logs

โš ๏ธ Upgrading from v1.x / v2.0.0

Migrations in this release are fresh-install schemas. If you are upgrading an existing database:

  1. Export your data first: php artisan role:export roles.json
  2. Drop the old package tables (or remove their rows from the migrations table), then run: php artisan migrate
  3. Re-import your data: php artisan role:import roles.json

โœ… Fresh installations are unaffected โ€” just run composer require + php artisan migrate.

๐Ÿงช Verified

  • โœ… Fresh install on MySQL 8 / SQLite / PostgreSQL
  • โœ… All 14 tables, indexes and foreign keys created correctly
  • โœ… 141 tests / 226 assertions passing
v2.0.0

๐ŸŽ‰ Laravel Permission Manager v2.0.0

A major release that transforms the package into an enterprise-grade authorization platform.

๐Ÿš€ What's New

Core Authorization Engine

  • AuthorizationManager: Centralized authorization engine with detailed decisions
  • AuthorizationResult: Rich result objects with reasons and metadata
  • WildcardMatcher: Enhanced with negation support (!users.delete)
  • PermissionSnapshot: Debug complete authorization state

Access Control

  • โœ… Direct User Permissions (givePermissionTo, denyPermissionTo)
  • โœ… Explicit Allow/Deny with precedence rules
  • โœ… Role Hierarchy with multi-level inheritance and cycle detection
  • โœ… Temporary Permissions with auto-expiration
  • โœ… Super Admin bypass (configurable)

Enterprise Features

  • ๐Ÿข Teams / Multi-Tenancy โ€” different roles per team
  • ๐Ÿง  ABAC (Attribute-Based Access Control) with JSON conditions
  • ๐Ÿ›ก๏ธ Multi-Guard support with guard_name
  • ๐Ÿ“ Audit Logging for all mutations
  • ๐Ÿ” Authorization Audit Trail (optional)
  • ๐Ÿ”” Events system for all state changes

Laravel Integration

  • ๐Ÿ” Gate::before() integration โ€” native can()/cannot() support
  • ๐Ÿ“‹ Policy support via PolicyResolver
  • ๐Ÿ›ก๏ธ Advanced Middleware DSL โ€” any/all/not modes
  • ๐ŸŽจ 12+ Blade directives โ€” [@role](https://github.com/role), [@hasanyrole](https://github.com/hasanyrole), [@unlesspermission](https://github.com/unlesspermission), etc.

Developer Experience

  • permission:why โ€” explain why access was denied
  • permission:doctor โ€” system health diagnostics
  • permission:tree โ€” role hierarchy visualization
  • permission:explain โ€” JSON authorization debug
  • permission:validate โ€” configuration validation
  • permission:prune โ€” cleanup expired permissions
  • permission:cache:warm โ€” cache preloading
  • permission:generate-resource โ€” CRUD permission generator

Testing

  • ๐Ÿงช 141 passing tests with 226 assertions
  • ๐ŸŽฏ Unit, Feature, and Integration suites
  • ๐Ÿงฐ Testing helpers: InteractsWithPermissions, PermissionAssertions

๐Ÿ“ฆ Installation

composer require hosseinhezami/laravel-permission-manager:^2.0
php artisan vendor:publish --provider="HosseinHezami\PermissionManager\PermissionManagerServiceProvider" --tag="config"
php artisan vendor:publish --provider="HosseinHezami\PermissionManager\PermissionManagerServiceProvider" --tag="migrations"
php artisan migrate

โฌ†๏ธ Upgrading from v1.x

No breaking changes โ€” all v1 methods, commands, and directives remain unchanged.

๐Ÿ“Š Comparison with v1.x

Feature v1.x v2.0
Direct Permissions โŒ โœ…
Role Hierarchy โŒ โœ…
Allow/Deny โŒ โœ…
Teams/Multi-Tenancy โŒ โœ…
ABAC โŒ โœ…
Audit Logging โŒ โœ…
Multi-Guard (real) โš ๏ธ โœ…
Smart Cache Basic Advanced
Tests 0 141

๐Ÿ™ Acknowledgments

Special thanks to all contributors and users who provided feedback during development.


Full Changelog: https://github.com/hosseinhezami/laravel-permission-manager/compare/v1.1.0...v2.0.0

v1.1.0

Added support for Laravel 13

v1.0.1

feat: Enhanced permission checking with array support and flexible validation logic

v1.0.0

A comprehensive and advanced permission management system for Laravel applications. This package provides a robust role-based access control (RBAC) system with support for wildcard permissions, blade directives, Artisan commands, and a fluent API.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode