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 yesterday

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 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

1199d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2941547?v=4)[James Ball](/maintainers/84115)[@84115](https://github.com/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

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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