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?

Was it helpful?

Solution

Please take a look at this function http://laravel.com/docs/security#manually

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
scroll top