2

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

  • Questions seeking help must include *the desired behavior*, *a specific problem or error* and *the shortest code necessary* to reproduce it **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Gustavo Morales Jun 14 '16 at 12:53

1 Answers1

2

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.

zeoce
  • 75
  • 5