PHPackages                             cdoebler/php-generic-user-switcher - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cdoebler/php-generic-user-switcher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cdoebler/php-generic-user-switcher
==================================

A framework-agnostic PHP package for user switching with a frontend component.

v1.0.1(5mo ago)0272MITPHPPHP ^8.2CI passing

Since Dec 14Pushed 5mo agoCompare

[ Source](https://github.com/cdoebler/php-generic-user-switcher)[ Packagist](https://packagist.org/packages/cdoebler/php-generic-user-switcher)[ RSS](/packages/cdoebler-php-generic-user-switcher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (2)

PHP Generic User Switcher
=========================

[](#php-generic-user-switcher)

A framework-agnostic PHP package for user switching with an integrated frontend component. Perfect for development and debugging, allowing seamless impersonation of different users without logging in and out.

Features
--------

[](#features)

- **Framework-Agnostic**: Works with any PHP application or framework
- **Clean Interface-Based Design**: Easy to extend and customize
- **Session-Based Impersonation**: Non-destructive user switching with preserved original user identity
- **Visual UI Component**: Beautiful, searchable dropdown widget for quick user switching
- **Type-Safe**: Built with PHP 8.2+ strict types and PHPStan level 10 validation
- **Zero Dependencies**: No external production dependencies
- **Fully Tested**: Comprehensive test coverage with Pest

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Session support (for default `SessionImpersonator`)

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

[](#installation)

Install via Composer:

```
composer require cdoebler/php-generic-user-switcher
```

Quick Start
-----------

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
