PHPackages                             akawam/authenticate-as-anyone - 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. akawam/authenticate-as-anyone

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

akawam/authenticate-as-anyone
=============================

Package that allows you to authenticate as anyone, see readme for more informations

1.2.2(3y ago)15.5k↑93.3%MITPHPPHP ^7.2.5 || ^8.0

Since Jul 5Pushed 3y agoCompare

[ Source](https://github.com/akawam/authenticate-as-anyone)[ Packagist](https://packagist.org/packages/akawam/authenticate-as-anyone)[ RSS](/packages/akawam-authenticate-as-anyone/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (7)Used By (0)

Authenticate as anyone
======================

[](#authenticate-as-anyone)

The purpose of this package is to allow restricted users to imitate another user account.

It is usefull when you want to see what exactly is happening on a certain user account.

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

[](#installation)

You can install the package via composer:

```
composer require akawam/authenticate-as-anyone
```

You can publish the view files with:

```
php artisan vendor:publish --provider="Akawam\AuthenticateAsAnyone\AuthenticateAsAnyoneServiceProvider" --tag="views"
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Akawam\AuthenticateAsAnyone\AuthenticateAsAnyoneServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'route-prefix' => 'authenticate-as-anyone', //required
    'middlewares' =>
        [
            'auth', //optional
        ],
    'models' =>
        [
            //required name of the Model
            'User' =>
                [
                    'namespace' => 'App\Models',//optional (default is App\Models)
                    'columns' => [
                        'name' => 'name', //optional (default is name)
                        'firstname' => 'firstname', //optional (default is firstname)
                        'login' => 'email',//optional (default is email)
                    ],
                ],
        ],
];
```

Usage
-----

[](#usage)

- Include the "logged as" ribbon

```
...

@aaaLogged

...

```

- Access module through url/route :
- Imitate a user

Adding your own event
---------------------

[](#adding-your-own-event)

When connecting as a user, an event is triggered (UserIsSwitching)

If you want to add some magic to your authentication (like adding some sessions data) you can do so by adding your own event listener like so :

```
// 'app/Providers/EventServiceProvider.php'
class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        UserIsSwitching::class => [
            TestListener::class
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}
```

Credits
-------

[](#credits)

- [Akawam](https://github.com/akawam)

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

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 ~159 days

Total

5

Last Release

1189d ago

### Community

Maintainers

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

---

Top Contributors

[![michael-legeay](https://avatars.githubusercontent.com/u/128613190?v=4)](https://github.com/michael-legeay "michael-legeay (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/akawam-authenticate-as-anyone/health.svg)

```
[![Health](https://phpackages.com/badges/akawam-authenticate-as-anyone/health.svg)](https://phpackages.com/packages/akawam-authenticate-as-anyone)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M307](/packages/laravel-horizon)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.7k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)

PHPackages © 2026

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