- How do I install stechstudio/filament-impersonate?
- Install it with Composer using composer require stechstudio/filament-impersonate. Then add the Impersonate action to your Filament UserResource table or page header actions. No additional service provider registration is required for the basic setup.
- Which Laravel and Filament versions does filament-impersonate support?
- The package is optimized for Laravel 10+ and Filament v3+. Some major features require Filament v5.x+ according to the technical assessment. Pin your Filament version in composer.json and test upgrades before deploying.
- How do I add an impersonate action to a Filament resource table?
- Open your resource class, usually UserResource, and import STS\FilamentImpersonate\Actions\Impersonate. In the table method, add Impersonate::make() to the actions array. This renders a one-click impersonate action for each row.
- How do I add impersonation to the EditUser page header in Filament?
- In the EditUser page class, override getHeaderActions and return an array containing Impersonate::make()->record($this->getRecord()). This places the impersonate button in the page header for the record being edited. You can also chain guard or redirectTo on that action.
- Can I impersonate users with a different auth guard?
- Yes. The Impersonate action supports per-action guard overrides, for example Impersonate::make()->guard('sanctum'). For multi-guard applications, set the guard explicitly or validate guard matching in your canImpersonate logic. The package works with Filament's default auth guard as well.
- How do I redirect after impersonating a user in Filament?
- Chain redirectTo on the action, such as Impersonate::make()->redirectTo(route('some.other.route')). If your Filament panel uses SPA navigation and the redirect target is not Livewire-aware, add withoutSpa() to force a full page load. That avoids broken SPA transitions.
- Is stechstudio/filament-impersonate compatible with Laravel Octane?
- The package is described as stateless and Octane-compatible, and it does not depend on lab404/laravel-impersonate. It avoids guard registration pitfalls that can affect long-running workers. Still, test it with your specific Octane driver, such as Swoole or FrankenPHP, in staging.
- How do I control who can impersonate another user?
- Implement canImpersonate() and canBeImpersonated() on your User model to define authorization rules. By default the package allows open impersonation, so misconfigured policies could expose sensitive accounts. Soft-deleted users are blocked by default, but that behavior is configurable via .env.
- Do I need to add an impersonation banner outside Filament?
- Yes. If your impersonated session visits non-Filament layouts, include the banner component with <x-impersonate::banner/> so users can see and leave impersonation. Otherwise you risk session or UX issues when leaving the Filament panel. Treat this as a critical onboarding step.
- Does filament-impersonate log impersonation events for audits?
- The package emits EnterImpersonation and LeaveImpersonation events that you can listen for in Laravel. It does not include logging by default, so add your own listener if you need audit trails or compliance records. This is useful for support workflows or regulated environments.