stechstudio/filament-impersonate
Filament plugin to impersonate users from your admin panel. Add an Impersonate action to resource tables or page header actions, with optional guard and redirect target. Supports SPA panels with an option to force full page loads when needed.
lab404/laravel-impersonate.EnterImpersonation, LeaveImpersonation) remain extensible for logging/analytics.Impersonation facade remains intact, reducing boilerplate for dynamic impersonation.Impersonate actions to UserResource and optional banner configuration).->guard('sanctum')) and Filament’s default auth guard support unchanged..env.composer.json and test upgrades.->guard() usage or validation in canImpersonate().<x-impersonate::banner/> to avoid session issues. Mitigation: Document as critical in onboarding.web, sanctum)? If so, how will impersonation handle guard mismatches?canImpersonate()/canBeImpersonated() methods already implemented? If not, what’s the fallback authorization logic?User model extend a custom trait or interface that might conflict with the package’s methods?/dashboard) or dynamic redirects (e.g., based on user role)?cookie_expiration in .env).config(['filament-impersonate.translations' => 'ru']) or similar.SessionGuard, custom guards, and Sanctum/Passport (if guard matches).<x-impersonate::banner/> for session awareness.composer require stechstudio/filament-impersonate
Impersonate action to UserResource (table and edit page)..env for guard, redirects, and cookie settings:
FILAMENT_IMPERSONATE_GUARD=web
FILAMENT_IMPERSONATE_REDIRECT=/dashboard
FILAMENT_IMPERSONATE_COOKIE_EXPIRATION=3600
FILAMENT_IMPERSONATE_TRANSLATIONS=ru # Russian (or 'tg' for Tajik, 'uz' for Uzbek)
canImpersonate()/canBeImpersonated() in User model if needed.viewAny).| Component | Compatibility Notes |
|---|---|
| Filament | v3+ required; v5.x+ for Octane/major features. |
| Laravel | 10+ (for Octane/session handling). |
| Auth Guards | Works with default SessionGuard; custom guards need explicit configuration. |
| Octane | Tested for Swoole/FrankenPHP; avoids guard registration issues. |
| Livewire | Integrates with Filament’s Livewire components (e.g., table actions). |
| Blade | Banner component requires Blade; no Inertia/React/Vue support. |
| Database | No schema changes; relies on Laravel’s session/auth tables. |
| Localization | Supports Russian, Tajik, Uzbek translations (new in v5.6.0). |
Impersonate actions to UserResource..env and banner (if needed)..env.canImpersonate()/canBeImpersonated().viewAny)..env-based (no config file publishing).Impersonate::make()->guard('sanctum'))..env without additional configuration.EnterImpersonation/LeaveImpersonation events enable logging/audit trails.Impersonation::isImpersonating() simplifies debugging in middleware/console.Log::warning() for failures (e.g., guard mismatches).How can I help you explore Laravel packages today?