evo-mark/laravel-impersonate
Impersonate Laravel users in one click. Add a trait to your User model to start/stop impersonation, with authorization hooks, middleware, events, Blade helpers, and configurable strategies. Supports Laravel 10–11 and PHP 8.2+.
TakeImpersonation, LeaveImpersonation) to log impersonation activities for audit trails, critical for regulated industries (e.g., finance, healthcare).canImpersonate()/canBeImpersonated() methods).web, admin, api) and impersonation must work across all.*"This package lets our support and admin teams log in as any user to debug issues or moderate content—just like clicking ‘View as Customer’ on Amazon. It’s a turnkey solution that:
composer require and 10 minutes of setup.
We’re prioritizing this for [Support Portal v2] to align with our goal of [CSAT improvement/KPI]."*Ask: "Should we allocate dev time to build this custom, or leverage this maintained package to ship faster?"
*"This is a batteries-included impersonation solution for Laravel that handles:
web, admin, or custom guards (e.g., api).canImpersonate()/canBeImpersonated() to your User model for granular control.@canImpersonate directives).TakeImpersonation/LeaveImpersonation for auditing or analytics.Why not roll our own?
Proposal:
composer.json and publish the config.User model with canImpersonate() logic (e.g., only allow managers).admin impersonating user sessions).Blockers to address:
canImpersonate() rules (e.g., ‘only admins can impersonate’).How can I help you explore Laravel packages today?