{"repo":"404labfr/laravel-impersonate","free":true,"listed":false,"github":"https://github.com/404labfr/laravel-impersonate","clone":"git clone https://github.com/404labfr/laravel-impersonate.git","description":"Laravel Impersonate is a plugin that allows you to authenticate as your users.","language":"PHP","stars":2340,"topics":["laravel-package","impersonate","php","user-management","laravel"],"license":null,"category":"auth-billing-email","readme_excerpt":"Laravel Impersonate Laravel Impersonate 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. - Requirements - Installation - Simple usage - Using the built-in controller - Advanced Usage - Defining impersonation authorization - Using your own strategy - Middleware - Events - Configuration - Blade - Tests - Contributors - Why Not Just Use loginAsId()? Requirements - Laravel 6.x to 13.x - PHP = 7.2 or = 8.0 Laravel support Version Release :-------------: :-------------: 6.x to 13.x 1.7 6.x, 7.x 1.6 5.8 1.5 5.7, 5.6 1.2 5.5, 5.4 1.1 Installation - Require it with Composer: - Add the service provider at the end of your config/app.php : - Add the trait Lab404\\Impersonate\\Models\\Impersonate to your User model. Simple usage Impersonate a user: Leave impersonation: Using the built-in controller In your routes file, under web middleware, you must call the impersonate route macro. Alternatively, you can execute this macro with your RouteServiceProvider . Advanced Usage Defining impersonation authorization By default all users can impersonate an user. You need to add the method canImpersonate() to your user model: By default all users can be impersonated . You need to add the method canBeImpersonated() to your user model to extend this behavior: Using your own strategy - Getting the manager: - Working with the manager: Middleware Protect From Impersonation You can use the middleware impersonate.protect to ","default_branch":null,"files":null,"tree":[],"storefront":"/r/404labfr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/404labfr/laravel-impersonate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}