Today, we are share with youu how to get current login user details in laravel. we are always need to sometime current login user details like id, name, email, profile picture etc..
So, here we are share with you how to get in to way. you also get current login user details in controller and blade in same way.
[ADDCODE]
Using Helper:
$user = auth()->user();
print($user->id);
print($user->name);
print($user->email);
Using Facade:
$user = Auth::user();
print($user->id);
print($user->name);
print($user->email);
We are hope this is helpfull to you...
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on harsukh21@gmail.com
How to create a string by joining the values of an array in PHP
Use the PHP implode() or ...How to Check Whether a String Contains a Substring in JavaScript
Use the indexOf() Method Th...How to Detect a Mobile Device in jQuery
Use the JS matchMedia() Method You ca...How to extract substring from a string in PHP
Use the PHP substr() function...How to Split a String into an Array of Characters in JavaScript
Use the split() Method The JavaScript...