Download the PHP package genealabs/laravel-impersonator without Composer
On this page you can find all versions of the php package genealabs/laravel-impersonator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download genealabs/laravel-impersonator
More information about genealabs/laravel-impersonator
Files in genealabs/laravel-impersonator
Package laravel-impersonator
Short Description Impersonate users in your Laravel and Nova apps.
License MIT
Informations about the package laravel-impersonator
Impersonator for Laravel
Supporting This Package
This is an MIT-licensed open source project with its ongoing development made possible by the support of the community. If you'd like to support this, and our other packages, please consider becoming a backer or sponsor on Patreon.
Pre-requisites
- Laravel 10.0+
- PHP 8.2+
Version Support Matrix
| Laravel | PHP |
|---|---|
| 10.x | 8.2, 8.3, 8.4, 8.5 |
| 11.x | 8.2, 8.3, 8.4, 8.5 |
| 12.x | 8.2, 8.3, 8.4, 8.5 |
| 13.x | 8.3, 8.4, 8.5 |
Installation
Configuration
genealabs-laravel-impersonator.layout: master blade layout view for your application (defaultlayouts.app).genealabs-laravel-impersonator.content-section: name of content section in master layout blade view (defaultcontent).genealabs-laravel-impersonator.user-model: user model of your application (defaultconfig('auth.providers.users.model')).genealabs-laravel-impersonator.middleware: the middleware to use for the impersonatee routes (default:['web', 'auth']). You may specifyonlyorexceptparameters. E.g.['web', 'auth', 'password.confirm' => ['except' => 'destroy']]
If you need to customize these settings:
Usage
- Add trait
GeneaLabs\LaravelImpersonator\Traits\Impersonatableto your user model. - Override trait method
public function getCanImpersonateAttribute() : boolthat determines if a given user can impersonate other users. - (optional) Override trait method
public function getCanBeImpersonatedAttribute() : boolthat determines if a given user can be impersonated. -
Use
route('impersonatees.index')to view a list of all impersonatable users. You could add something like the following to your menu: - (optional) Add something like the following to your menu view to allow imporsonator to stop impersonating:
Customization
Credits
In large part prodded and inspired by LaraCasts' tutorial: https://laracasts.com/series/how-do-i/episodes/17. Thank you @JeffreyWay!
All versions of laravel-impersonator with dependencies
illuminate/config Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/session Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/view Version ^11.0|^12.0|^13.0