Skip to main content
Back to packages
2,318 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

Laravel 13 Eloquent: Expert Level

41 lessons
1 h 34 min

How to Build Laravel 13 API From Scratch

30 lessons
1 h 23 min

[FREE] Laravel 13 for Beginners: 3 Demo Projects

5 lessons
29 min

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.