I am new to laravel and I am working with a functionality where we insert data in user table with
DB::insert();
After that i get last id with
$user_id = DB::getPdo()->lastInsertId();
Now I want user to login after register and I am trying to
Auth::loginUsingId($user_id);
But its returning me false. I also tried
$user = User::find($user_id);
Auth::login($user);
Its also return null $user.
Please help...
Login User:
Auth::login($user);
check current user is login or not:
Auth::check();