PHPackages                             pentangle/laravel-backpack-impersonation-addon - 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. pentangle/laravel-backpack-impersonation-addon

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

pentangle/laravel-backpack-impersonation-addon
==============================================

Backpack for Laravel Addon allows backpack users to impersonate other users

1.0.2(4y ago)0412MITPHPPHP ^8.0

Since Jul 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Pentangle/laravel-backpack-impersonation-addon)[ Packagist](https://packagist.org/packages/pentangle/laravel-backpack-impersonation-addon)[ Docs](https://github.com/pentangle/laravel-backpack-impersonation-addon)[ GitHub Sponsors](https://github.com/Pentangle)[ RSS](/packages/pentangle-laravel-backpack-impersonation-addon/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (5)Dependencies (8)Versions (6)Used By (0)

Backpack for Laravel Addon allows backpack users to impersonate other users
===========================================================================

[](#backpack-for-laravel-addon-allows-backpack-users-to-impersonate-other-users)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c62d3b2bf2cb3307ad02f3a74bfded04b6b2858b6aafee57f3fa3d8d1d9fc2cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70656e74616e676c652f6c61726176656c2d6261636b7061636b2d696d706572736f6e6174696f6e2d6164646f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pentangle/laravel-backpack-impersonation-addon)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3196d62d64fdebfac1314af5b702fc15d626143b149514edcff3a8ce35e371ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70656e74616e676c652f6c61726176656c2d6261636b7061636b2d696d706572736f6e6174696f6e2d6164646f6e2f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/pentangle/laravel-backpack-impersonation-addon/actions?query=workflow%3ATests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3ac4ea5b1fe145f38613d1b173efce15d15e45fd631082c45e6766a5843416f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70656e74616e676c652f6c61726176656c2d6261636b7061636b2d696d706572736f6e6174696f6e2d6164646f6e2f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/pentangle/laravel-backpack-impersonation-addon/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/0a117da2bf0adfd9b94b01b207b7c6b3493b1b4770d597208f37b092b9d4e6d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70656e74616e676c652f6c61726176656c2d6261636b7061636b2d696d706572736f6e6174696f6e2d6164646f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pentangle/laravel-backpack-impersonation-addon)

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

[](#installation)

You can install the package via composer:

```
composer require pentangle/laravel-backpack-impersonation-addon
```

Setup
-----

[](#setup)

add the trait to the desired user model

```
use UserImpersonationTrait;

```

override the existing functions by adding them to the model

```
    /**
     * @return bool
     */
    public function canImpersonate()
    {
        return true;
    }

    /**
     * @return bool
     */
    public function canBeImpersonated()
    {
        return true;
    }

    public function impersonateButton($crud = false)
    {
        return 'Impersonate this user';
    }

```

add the following code to your routes file web.php

```
Route::impersonate();

```

add the following code to the ModelCrudController

```
$this->crud->addButton('line', 'impersonateButton', 'model_function', 'impersonateButton');

```

Publish the config file to configure custom routes

```
php artisan vendor:publish --tag=impersonate

```

config/laravel-impersonate.php

```

    /**
     * The session key used to store the original user id.
     */
    'session_key' => 'impersonated_by',

    /**
     * The session key used to stored the original user guard.
     */
    'session_guard' => 'impersonator_guard',

    /**
     * The session key used to stored what guard is impersonator using.
     */
    'session_guard_using' => 'impersonator_guard_using',

    /**
     * The default impersonator guard used.
     */
    'default_impersonator_guard' => 'web',

    /**
     * The URI to redirect after taking an impersonation.
     *
     * Only used in the built-in controller.
     * * Use 'back' to redirect to the previous page
     */
    'take_redirect_to' => '/',

    /**
     * The URI to redirect after leaving an impersonation.
     *
     * Only used in the built-in controller.
     * Use 'back' to redirect to the previous page
     */
    'leave_redirect_to' => '/',

```

Credits
-------

[](#credits)

- [Séan Poynter-Smith](https://github.com/Pentangle)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~56 days

Total

5

Last Release

1532d ago

Major Versions

0.0.2 → 1.0.02021-09-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/e705d3c99d69560b9ee09ad425d0243f89cab5108940b11347f4ab62d8ba8821?d=identicon)[pentangle](/maintainers/pentangle)

---

Top Contributors

[![spoyntersmith](https://avatars.githubusercontent.com/u/22387308?v=4)](https://github.com/spoyntersmith "spoyntersmith (10 commits)")

---

Tags

pentanglelaravel-backpack-impersonation-addon

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pentangle-laravel-backpack-impersonation-addon/health.svg)

```
[![Health](https://phpackages.com/badges/pentangle-laravel-backpack-impersonation-addon/health.svg)](https://phpackages.com/packages/pentangle-laravel-backpack-impersonation-addon)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

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