stechstudio/filament-impersonate
A Filament plugin that lets admins impersonate users with a single action. Add Impersonate to your resource table or page header, with optional guard and redirect settings.
Architecture fit. stechstudio/filament-impersonate is a deliberately thin, single-purpose Filament plugin: it registers a table action and a page action (STS\FilamentImpersonate\Actions\Impersonate), ships a Blade banner component (<x-impersonate::banner/>), and exposes a small facade (Impersonation::isImpersonating(), leave()) for programmatic control. It layers cleanly onto an existing Laravel auth model rather than introducing its own user/session store, and authorization is delegated to optional canImpersonate() / canBeImpersonated() methods on the user model — conventional Laravel policy-style extension points that our team already understands. For any Laravel + Filament admin panel with a UserResource, integration is measured in hours, not sprints.
Integration feasibility. Installation is a single Composer require with no mandatory migrations and no database schema change. Configuration is entirely ENV-driven (FILAMENT_IMPERSONATE_*), so we avoid publishing and maintaining a config file across environments — a meaningful plus for config-as-code discipline. Two integration details carry real work:
InteractsWithPageTable 403 failure requires a guard clause in UserPolicy::viewAny(), i.e., a policy change in our codebase to accommodate plugin rendering behavior.Technical risk.
Key questions.
Login/Logout listeners ourselves?Stack fit. Native fit for Laravel + Filament. The plugin assumes Eloquent-backed authenticatable models, Laravel guards, Blade, and Livewire — no impedance mismatch, no additional infrastructure, no queue or cache dependency. It is a pure application-layer concern.
Migration path. Because there is nothing to migrate at the data layer, "migration" here means feature rollout, not schema migration:
composer.json (e.g., ^5.0 alongside Filament 5) to prevent silent cross-major drift.canImpersonate() restricted to an explicit admin flag — never rely on the default "any authenticated Filament user can impersonate."canBeImpersonated() excluding service accounts, internal/staff addresses, and billing-owner accounts.UserPolicy::viewAny() impersonation guard clause at the same time as the action, not after the first 403 report.Compatibility. Validate the matrix before committing: PHP version, Laravel major, Filament major, Livewire major, and our session driver. Watch specifically for: ->spa() panels (use ->withoutSpa() for non-Livewire redirect targets), modal/Livewire redirect contexts (fixed in 4.1.2), and multi-guard banner rendering (fixed in 4.1.1). Anything on 3.x/4.x should be treated as a distinct compatibility profile with its own tested pin.
Sequencing.
canImpersonate/canBeImpersonated, write the recovery runbook.Maintenance. Low steady-state effort: ENV-only configuration, no schema, no scheduled jobs, upgrades are Composer bumps. The real maintenance burden is governance — keeping the authorized-impersonator list current and keeping audit records retained per policy. Budget roughly a day per Filament major upgrade for plugin validation, and treat the plugin's release notes as required reading in that window.
Support. Community-supported upstream (GitHub issues/PRs, small maintainer team). Our internal support surface is narrow: admins only, trained, and few. Recommend designating one internal owner for the plugin, documented in the runbook, plus a fallback path (feature-flag disable) that does not require a deploy.
Scaling. Effectively zero incremental load — impersonation is a per-operator, low-frequency admin action. Two scale-adjacent notes: (a) impersonating into accounts with large tenant datasets inherits their query cost, so a "view as" into a heavy tenant can look like a performance regression that is not the plugin's fault; (b) Livewire widget re-render during redirect is the known trigger for the 403 path, so panels with many table widgets deserve explicit testing.
Failure modes.
leave() escape hatch.viewAny() guard clause.FILAMENT_IMPERSONATE_ALLOW_SOFT_DELETED override should stay off unless there is a specific compliance need.Ramp-up. Developer ramp-up is under an hour given the README and framework familiarity. Operator ramp-up is a short training note plus the banner as an always-visible in-product reminder. The non-obvious cost is the security/compliance review, which is the gate that actually determines the timeline.
How can I help you explore Laravel packages today?