Please take a look at this function http://laravel.com/docs/security#manually
Authentication from admin panel in Laravel 4
-
03-06-2023 - |
Question
What I want to do is authenticating user from admin panel. I am going to use this in order to manage a user's account from admin panel. I can not use laravel authenticate function because I have users hashed password. Is it possible to reverse hashed password? Otherwise, is it possible to authenticate user from username?
Solution
OTHER TIPS
It's possible in many ways:
Auth::loginUsingId(1); // using id 1
Or use this:
$user = User::find(1); // using id 1
Auth::login($user);
Or as you asked to log in using username, so you may try this:
$user = User::where('username', 'someUser')->first();
Auth::login($user);
If you know the id
then you may use loginUsingId($id)
method.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow