iotronlab/filament-multi-guard
auth:guard()) and Filament’s context middleware, making it a lightweight extension rather than a full rewrite. Avoids reinventing core auth logic.FilamentMultiGuardServiceProvider (boot method).admin, tenant-1) and dynamic context resolution.FilamentTestCase).config/auth.php (e.g., multi-guard driver). Misconfiguration could lead to access control gaps.tenant-{id} guards).admin, editor, viewer contexts).config/auth.php (e.g., multi-guard driver with custom user providers).filament/filament:^2.x is installed.composer require iotronlab/filament-multi-guard
php artisan vendor:publish --tag="filament-multi-guard-config".AppServiceProvider or a dedicated service provider:
FilamentMultiGuard::context('admin')
->resources([PostResource::class])
->pages([Dashboard::class]);
admin guard sees only PostResource).auth:guard('tenant-1')).auth:guard() or custom middleware.Cache::remember for performance.admin).tenant-1, editor).Log::debug() to context resolution methods.config/auth.php.Cache::remember).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Filament v3 migration | Package becomes unusable | Plan v3 adoption early; use native features. |
| Guard misconfiguration | Access denied/permission leaks | Validate guards in config/auth.php. |
| Context resolution error | Blank admin panel | Add error logging; use fallback guard. |
| PHP version incompatibility | Package fails to load | Pin PHP 8.0+ in composer.json. |
| Tenant/role explosion |
How can I help you explore Laravel packages today?