seisigmasrl / laravel-access-profiles
Scoped access profiles for multi-tenant Laravel apps: per-scope assignments, deny rules, validity windows and an audit trail, next to Laravel's Gate.
Package info
github.com/seisigmasrl/laravel-access-profiles
Language:HTML
pkg:composer/seisigmasrl/laravel-access-profiles
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/auth: ^12.69||^13.30
- illuminate/cache: ^12.69||^13.30
- illuminate/console: ^12.69||^13.30
- illuminate/contracts: ^12.69||^13.30
- illuminate/database: ^12.69||^13.30
- illuminate/events: ^12.69||^13.30
- illuminate/support: ^12.69||^13.30
- illuminate/view: ^12.69||^13.30
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1
- orchestra/testbench: ^11.0||^10.0
- pestphp/pest: ^3.0||^4.0
- pestphp/pest-plugin-arch: ^3.0||^4.0
- pestphp/pest-plugin-laravel: ^3.0||^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.1.2
- v0.1.1
- v0.1.0
- dev-docs-custom-domain
- dev-website-domain
- dev-website
- dev-docs/fossa-license-badge
- dev-feature/key-segments
- dev-repo-meta
- dev-docs/readme-condense
- dev-docs/post-release-facts
- dev-s11-memo-test
- dev-s4-builders
- dev-s9-trait-blade
- dev-s10-docs
- dev-s11-deps
- dev-s8-commands
- dev-s7-events
- dev-s6-queries
This package is auto-updated.
Last update: 2026-10-29 22:01:18 UTC
README
Give people different permissions in different parts of a tenant. Profiles combine allow and deny rules, and any matching deny wins. Assignments cover a whole tenant or selected scopes, with validity dates and a record of who granted access and why.
Access is denied by default. There is no global current tenant and no owner bypass: every check takes a target.
Documentation: laravel-access-profiles.packages.seisigma.co
Requirements
PHP 8.3+ and Laravel 12.69+ or 13.30+. Runtime dependencies are PHP and illuminate/*. See Getting started.
Installation
composer require seisigmasrl/laravel-access-profiles php artisan vendor:publish --tag=access-profiles-config php artisan vendor:publish --tag=access-profiles-migrations
Define your catalogue and templates and choose table names. Then migrate and sync the templates:
php artisan migrate php artisan access-profiles:sync-templates
Usage
Grant a profile in two sites of a team for six months. The grantor and the reason are stored with the assignment.
$assignment = Access::grant('reviewer')->to($user)->in($team) ->onlyScopes([$site, $otherSite])->titled('Review cover') ->validFrom(now())->validUntil(now()->addMonths(6)) ->by($admin)->because('Cover leave')->save();
Then check access with Access::for($user)->can('billing.invoice.view', $site) or $user->canAccess(...).
Documentation
- Getting started: requirements, install, config, commands.
- Concepts: tenant, scope, profile, assignment and the decision rules.
- Catalogue and templates: keys, templates, profiles, assignments and guards.
- Checking access: checks, Blade, Inertia, policies and queues.
- Scoped queries: who holds a key, which scopes a holder reaches, history.
- Events and audit: write events for your audit log.
- Testing and Upgrading.
- DESIGN.md for the decisions and COMPARISON.md for alternatives.
When not to use it
- One tenant or one flat team level: consider spatie/laravel-permission.
- A few fixed roles: Laravel's Gates and policies may be enough.
- Record-level rules or an admin UI out of the box: this package has neither.
- A mature, proven package today: this package is new. Review it before you rely on it for access control.
Testing
composer test
Each fenced PHP example in this README has a behaviour test in ReadmeExamplesTest.php.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Package layout follows spatie/package-skeleton-laravel.
License
The MIT License (MIT). Please see License File for more information.