PHPackages                             xlite-dev/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xlite-dev/filament-impersonate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xlite-dev/filament-impersonate
==============================

This is my package filament-impersonate

3.0.1(5mo ago)4159.6k↓61%4[1 issues](https://github.com/xlited/filament-impersonate/issues)MITPHPPHP ^8.1

Since Oct 26Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/xlited/filament-impersonate)[ Packagist](https://packagist.org/packages/xlite-dev/filament-impersonate)[ Docs](https://github.com/xlite-dev/filament-impersonate)[ GitHub Sponsors](https://github.com/icaliman)[ RSS](/packages/xlite-dev-filament-impersonate/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (14)Versions (20)Used By (0)

Filament Impersonate - Authenticate as your users
=================================================

[](#filament-impersonate---authenticate-as-your-users)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1fc981641a3fd3f54a44c9d4dae087c4950077a5d4885b5084b087dcbe330875/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f786c6974652d6465762f66696c616d656e742d696d706572736f6e6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xlite-dev/filament-impersonate)[![Total Downloads](https://camo.githubusercontent.com/d5e1e3853a0771f532c98b48e75a0256a0c2b1e97b8e9d2f462b771e922d19e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f786c6974652d6465762f66696c616d656e742d696d706572736f6e6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xlite-dev/filament-impersonate)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require xlite-dev/filament-impersonate:^3.0
```

Compatibility
-------------

[](#compatibility)

Package versionFilament versionv2v3v3v4, v5Usage
-----

[](#usage)

### 1. Add `Table` action

[](#1-add-table-action)

Open the resource where you want the impersonate action to appear. This is generally going to be your `UserResource` class.

Go down to the `table` method. Inside `actions` or `prependActions` add `ImpersonateAction::make` as a new action for the table. Your class should look like this:

```
namespace App\Filament\Resources;

use Filament\Resources\Resource;
use XliteDev\FilamentImpersonate\Actions\ImpersonateAction; // columns([
                // ...
            ])
            ->actions([
                ImpersonateAction::make(), // getRecord()), //  env('FILAMENT_IMPERSONATE_GUARD', 'web'),

    // After impersonating this is where we'll redirect you to.
    'redirect_to' => env('FILAMENT_IMPERSONATE_REDIRECT', '/'),

    // We wire up a route for the "leave" button. You can change the middleware stack here if needed.
    'leave_middlewares' => [
        env('FILAMENT_IMPERSONATE_LEAVE_MIDDLEWARE', 'web'),
    ],

    'banner' => [
        // Currently supports 'dark' and 'light'.
        'style' => env('FILAMENT_IMPERSONATE_BANNER_STYLE', 'dark'),

        // Turn this off if you want `absolute` positioning, so the banner scrolls out of view
        'fixed' => env('FILAMENT_IMPERSONATE_BANNER_FIXED', true),

        // Currently supports 'top' and 'bottom'.
        'position' => env('FILAMENT_IMPERSONATE_BANNER_POSITION', 'top'),
    ],
];
```

Authorization
-------------

[](#authorization)

By default, only Filament admins can impersonate other users. You can control this by adding a `canImpersonate` method to your `FilamentUser` class:

```
class User implements FilamentUser {

    public function canImpersonate()
    {
        return true;
    }

}
```

You can also control which targets can *be* impersonated. Just add a `canBeImpersonated` method to the user class with whatever logic you need:

```
class User {

    public function canBeImpersonated()
    {
        // Let's prevent impersonating other users at our own company
        return !Str::endsWith($this->email, '@mycorp.com');
    }

}
```

Customizing the banner
----------------------

[](#customizing-the-banner)

You can publish the views using

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

The blade component has a few options you can customize.

### Style

[](#style)

The banner is dark by default, you can set this to light:

```

```

### Display name

[](#display-name)

The banner will show the name of the impersonated user, assuming there is a `name` attribute. You can customize this if needed:

```

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ion Caliman](https://github.com/icaliman)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance72

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90.2% 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

Every ~70 days

Recently: every ~84 days

Total

18

Last Release

154d ago

Major Versions

1.1.4 → 2.0.0-beta12023-05-01

v2.x-dev → 3.0.02025-12-11

PHP version history (2 changes)1.0PHP ^8.0

2.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/93930429?v=4)[xlited](/maintainers/xlited)[@xlited](https://github.com/xlited)

![](https://avatars.githubusercontent.com/u/4498933?v=4)[Ion Căliman](/maintainers/icaliman)[@icaliman](https://github.com/icaliman)

---

Top Contributors

[![icaliman](https://avatars.githubusercontent.com/u/4498933?v=4)](https://github.com/icaliman "icaliman (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![a21ns1g4ts](https://avatars.githubusercontent.com/u/11599205?v=4)](https://github.com/a21ns1g4ts "a21ns1g4ts (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![janyksteenbeek](https://avatars.githubusercontent.com/u/3578636?v=4)](https://github.com/janyksteenbeek "janyksteenbeek (1 commits)")

---

Tags

laravelfilament-impersonateXliteDev

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

284.5k1](/packages/finity-labs-fin-mail)

PHPackages © 2026

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