Search by

seisigmasrl / laravel-access-profiles

seisigma

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

Homepage

Documentation

Language:HTML

pkg:composer/seisigmasrl/laravel-access-profiles

Fund package maintenance!

ricardov03

Statistics

Installs: 182

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v0.1.2 2026-10-29 17:45 UTC

README

Latest Version on Packagist Tests PHPStan Total Downloads FOSSA Status FOSSA Status

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

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.

FOSSA Status