Skip to main content
Back to packages
2,326 GitHub stars

404labfr/laravel-impersonate

View on GitHub

Description

Makes it easy to authenticate as your users. Add a simple trait to your user model and impersonate as one of your users in one click.


Simple usage:

Impersonate a user:

Auth::user()->impersonate($other_user);
// You're now logged as the $other_user

Leave impersonation:

Auth::user()->leaveImpersonation();
// You're now logged as your original user.

Related Content on Laravel Daily

Video

Recent Courses on Laravel Daily