PHPackages                             j84115/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. j84115/impersonate

ActiveLaravel-package[Authentication &amp; Authorization](/categories/authentication)

j84115/impersonate
==================

...

V0.1.0(3y ago)16PHP

Since Mar 22Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel-Impersonate
===================

[](#laravel-impersonate)

A simple Laravel Package to temporarily login as other users.

Usage
-----

[](#usage)

You can login to another user through `{app_url}/impersonate/login/{user_id}`.

And you can end the session with `{app_url}/impersonate/logout`.

Install Package
---------------

[](#install-package)

`composer require j84115/impersonate` Not yet on Packagist. Install manually.

Add Sevice Provider
-------------------

[](#add-sevice-provider)

Add the Package to `config/app.php`

```
J84115\Impersonate\ImpersonateServiceProvider::class,
```

Add Interface To User
---------------------

[](#add-interface-to-user)

Add the Interface to your User Model. Typically `app/Models/User.php`.

```
use J84115\Impersonate\Interfaces\ImpersonateUser;
```

Implement the interface.

```
class User extends Authenticatable implements ImpersonateUser
```

Then add your conditions for who can impersonate a user.

```
    public function impersonator(): bool
    {
        return $this->role === 'admin';
    }

    public function impersonatable(): bool
    {
        return $this->email !== 'admin';
    }
```

Routing
-------

[](#routing)

Add the following macro to your routes. Typically guarded with auth Middleware in `routes/web.php`.

```
Route::impersonate();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

1147d ago

### Community

Maintainers

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

---

Top Contributors

[![84115](https://avatars.githubusercontent.com/u/2941547?v=4)](https://github.com/84115 "84115 (22 commits)")

---

Tags

laravel-package

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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