Need help. How to create session after login with the user details in laravel?
By : afzaal ahmad
Date : March 29 2020, 07:55 AM
I wish this helpful for you You can get the currently logged in user with Auth::user(). So, if you wanted to store the user's username in the session after login you could do this: code :
$user = Auth::user();
Session::put('username', $user->username);
|
Storing user details in session but without login him yet in Laravel
By : VickyT
Date : March 29 2020, 07:55 AM
wish helps you Is it possible when user type his login username and password to store his details and redirect him to another page where I will query database for addition information which he provide before to log him? Consider this scenario: , You can fix your code like this: code :
public function loginAuth()
{
$data = Session::get('user');
$key = DB::table('users')->select('key')->where('user_id', '=', $data->user_id)->first();
return View::make('site.users.auth', [
'key' => $key
]);
}
|
Notify user when next time user login in Laravel 5.4 Application
By : ashutoshP
Date : March 29 2020, 07:55 AM
seems to work fine I think storing notifications in the database would be the way to go too. If you add a many-to-many relationship between your User and Notification models, with a is_read flag on the relationship pivot table.
|
Store user login details to DB in Laravel
By : Rishabh Mahajan
Date : March 29 2020, 07:55 AM
Any of those help add an authenticated method to your login controller, this method gets called right after the authentication process code :
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
use AuthenticatesUsers;
/**
* @param Request $request
* @param Authenticatable $user
* @return \Illuminate\Http\RedirectResponse
*/
protected function authenticated(Request $request, Authenticatable $user)
{
/* Your db inserts */
return redirect()->intended($this->redirectTo);
}
}
|
Get Login user details in laravel resource
By : yashisan
Date : March 29 2020, 07:55 AM
I hope this helps . See Laravel documentation https://laravel.com/docs/5.5/authentication code :
// Get the currently authenticated user...
$user = Auth::user();
// Get the currently authenticated user's ID...
$id = Auth::id();
|