How to impersonate any user in a laravel 4 app

393 Views Asked by At

Hi I want to switch to users accounts and browse their profiles I found this tutorial Easily impersonate any user in laravel 5 app about impersonating but it works for laravel 5 and I am using laravel 4

1

There are 1 best solutions below

0
zeoce On

You can simply use the Auth facade within a controller

Auth::loginUsingId($userId);

Of course you need to make sure the controller has appropriate restrictions to block unauthorized use of it.