PHPackages                             abdullyahuza/filament-impersonate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. abdullyahuza/filament-impersonate

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

abdullyahuza/filament-impersonate
=================================

Filament Impersonate allows administrators to securely impersonate other users within the Filament admin panel. With a simple "Impersonate" action, admins can log in as another user to troubleshoot issues, test permissions, or preview user-specific content. A visible banner indicates impersonation mode, with an easy one-click return to the original account.

v1.0.0(9mo ago)018MITPHPPHP ^8.1

Since Jul 21Pushed 9mo agoCompare

[ Source](https://github.com/abdullyahuza/filament-impersonate)[ Packagist](https://packagist.org/packages/abdullyahuza/filament-impersonate)[ RSS](/packages/abdullyahuza-filament-impersonate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![DEMO UI](resources/github/shots/ui.png)](resources/github/shots/ui.png)

🎭 Filament Impersonate
======================

[](#-filament-impersonate)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

A plugin for [Filament Admin Panel](https://filamentphp.com/) that allows authorized users to impersonate other users.

---

📦 Installation
--------------

[](#-installation)

```
composer require abdullyahuza/filament-impersonate
```

Optionally publish the config file:

```
php artisan vendor:publish --tag="filament-impersonate-config"
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Inside `config/filament-impersonate.php`:

```
return [

    'redirect_after_impersonation' => 'filament.app.pages.dashboard',

    'guard' => 'web',

    'user_model' => \App\Models\User::class,

    'session_key' => 'filament_impersonator_id',

    'excluded_user_ids' => [/* user IDs that should never be impersonated */],

    'allowed_environments' => ['local', 'staging', 'production'],

    'display_name_resolver' => fn ($user) => $user->name ?? 'Unknown User',

    'can_impersonate_resolver' => fn ($user) => $user?->hasRole('admin') || $user?->can('impersonate users'),

];
```

### Setup Filament-Impersonate

[](#setup-filament-impersonate)

#### Install for Panel

[](#install-for-panel)

```
->plugins([
	...
	FilamentImpersonate::make(),
])

```

```
->middleware([
	...
	// AuthenticateSession::class,
])

```

---

✅ Usage
-------

[](#-usage)

### Impersonate a user

[](#impersonate-a-user)

1. From the Filament UI, click the impersonation button shown next to user profile (if allowed).
2. You will be logged in as that user.
3. A banner or button will appear indicating impersonation — click it to stop impersonating.

### Stop impersonating

[](#stop-impersonating)

Click the **"Stop Impersonating"** button to return to your original user session.

---

🔐 Permissions
-------------

[](#-permissions)

To restrict who can impersonate users, configure the `can_impersonate_resolver` in your config file.

Example:

```
'can_impersonate_resolver' => fn ($user) => $user?->hasRole('admin') || $user?->can('impersonate_users'),
```

---

💾 Session Management
--------------------

[](#-session-management)

During impersonation, the following is stored in the session:

- Impersonator ID
- Original user roles &amp; permissions (if applicable)

These are restored when impersonation is stopped.

---

🛡️ Notes
--------

[](#️-notes)

- Only users not in `excluded_user_ids` can be impersonated.
- Impersonation only works in environments defined in `allowed_environments`.
- You can customize how user names are displayed using `display_name_resolver`.

---

🧪 Testing
---------

[](#-testing)

Ensure your environment is included in `allowed_environments` for local testing.

```
'allowed_environments' => ['local'],
```

---

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance56

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

295d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c52a41515d874f365ee7659f9e3b30f49f695146372df4c49a30380fb8801ca?d=identicon)[abdullyahuza](/maintainers/abdullyahuza)

---

Top Contributors

[![abdullyahuza](https://avatars.githubusercontent.com/u/40579655?v=4)](https://github.com/abdullyahuza "abdullyahuza (17 commits)")

### Embed Badge

![Health badge](/badges/abdullyahuza-filament-impersonate/health.svg)

```
[![Health](https://phpackages.com/badges/abdullyahuza-filament-impersonate/health.svg)](https://phpackages.com/packages/abdullyahuza-filament-impersonate)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[althinect/filament-spatie-roles-permissions

340954.7k9](/packages/althinect-filament-spatie-roles-permissions)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

213914.9k9](/packages/dutchcodingcompany-filament-socialite)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34450.0k2](/packages/andrewdwallo-filament-companies)[chiiya/filament-access-control

Admin user, role and permission management for Laravel Filament

21847.2k](/packages/chiiya-filament-access-control)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
