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. xlite-dev/filament-impersonate

ActiveLibrary

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

This is my package filament-impersonate

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

Since Oct 26Pushed 3mo 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 1mo 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

54

—

FairBetter than 97% of packages

Maintenance80

Actively maintained with recent releases

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

108d 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://www.gravatar.com/avatar/faf252410d4cd4cd461d6b787261042b1e737f93b271dc91ef1ad8263dded0f3?d=identicon)[icaliman](/maintainers/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

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

206120.5k1](/packages/guava-filament-knowledge-base)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

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