Download the PHP package verseles/possession without Composer
On this page you can find all versions of the php package verseles/possession. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download verseles/possession
More information about verseles/possession
Files in verseles/possession
Download verseles/possession
More information about verseles/possession
Files in verseles/possession
Vendor verseles
Package possession
Short Description Laravel user impersonation package with Sanctum compatibility
License MIT
Package possession
Short Description Laravel user impersonation package with Sanctum compatibility
License MIT
Please rate this library. Is it a good library?
Informations about the package possession
Laravel Possession - User Impersonation Package
A simple user impersonation package for Laravel with Sanctum compatibility.
Features
- Secure user impersonation system
- Global
possess()
andunpossess()
methods - Comprehensive exception handling
- Session-based impersonation
- Sanctum compatibility
- Simple administration controls
- Visual impersonation indicator
- Easy to integrate
Warning
- This package is still in development, so use it with caution.
- It wasn't tested with all Laravel versions, only with Laravel 11.
Installation
-
Install via Composer:
-
Publish the configuration file (optional):
- Add the trait to your User model:
Usage
Global Methods
Use the facade for direct impersonation control:
Web Routes Example
Blade Templates
Start Impersonation:
Stop Impersonation:
Error Handling
The package throws specific exceptions you can catch:
Available exceptions:
UnauthorizedPossessException
UnauthorizedUnpossessException
TargetCannotBePossessedException
SelfPossessionException
NoImpersonationActiveException
Configuration
Edit config/possession.php
after publishing:
Security Considerations
- Always protect impersonation routes with middleware
- Use separate guards for admin and regular users
- Regularly review your
canPossess()
andcanBePossessed()
logic - Never expose impersonation controls to non-administrative users
License
The MIT License (MIT)
All versions of possession with dependencies
PHP Build Version
Package Version
The package verseles/possession contains the following files
Loading the files please wait ....