Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Impersonate

Filament Impersonate Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Filament plugin that makes it easy to impersonate your users

Frequently asked questions about Filament Impersonate
How do I add an impersonate action to a Filament resource table?
Edit your `UserResource` class and add `Impersonate::make()` to the `actions` array inside the `table` method. For example: `->actions([Impersonate::make()])`. This adds a clickable button in the table row for each user.
Does this package work with Laravel Sanctum or Passport?
Yes, but you must explicitly specify the guard using `->guard('sanctum')` or `->guard('api')` when configuring the impersonate action. The default guard is Filament’s primary guard, so ensure your Sanctum/Passport routes are properly configured.
Can I customize the redirect URL after impersonation?
Absolutely. Use `->redirectTo(route('dashboard'))` or any valid route/URL in the `Impersonate::make()` configuration. For non-Livewire routes, add `->withoutSpa()` to force a full page reload in SPA panels.
Is this compatible with Laravel Octane (Swoole/FrankenPHP)?
Yes, the package is tested for Octane compatibility. However, ensure your Octane driver (Swoole/FrankenPHP) is properly configured, as impersonation relies on session handling. No additional setup is required unless you encounter guard-specific issues.
How do I restrict impersonation to specific users (e.g., admins only)?
Override the `canImpersonate()` method in your `User` model or use Filament’s built-in authorization. For example, add `public function canImpersonate(): bool { return $this->isAdmin(); }` to your model. The package defaults to open impersonation if no logic is defined.
Will impersonation work with soft-deleted users by default?
No, the package blocks impersonation of soft-deleted users by default. To change this, set `IMPERSONATE_ALLOW_SOFT_DELETES=true` in your `.env` file. This is configurable to prevent accidental impersonation of inactive accounts.
How do I add the impersonation banner to non-Filament layouts?
Include the banner component directly in your Blade templates using `<x-impersonate::banner />`. This ensures session awareness outside Filament’s SPA context. The banner automatically appears when a user is being impersonated.
Does this package support multilingual impersonation labels?
Yes, it includes translations for Russian, Tajik, and Uzbek. Enable them by adding `config(['filament-impersonate.translations' => 'ru'])` (or your language code) in your `AppServiceProvider`. Custom translations can also be added via the `lang` directory.
Can I log impersonation events for audit purposes?
The package emits `EnterImpersonation` and `LeaveImpersonation` events, which you can listen to in an event service provider. For example, log these events to a database or third-party service for compliance tracking.
What Laravel and Filament versions are supported?
This package requires Laravel 10+ and Filament v3+. For Filament v5.x features, ensure you’re using the latest version of the package. Always pin your Filament version in `composer.json` to avoid compatibility issues during upgrades.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky