简体   繁体   中英

How to get logged user id from database using session in laravel 6

I am trying to get logged user id from database using laravel but i am lacking. Please help me to get logged user id from database using session. Thanks in advance

You can get the user id by using the user method on the Auth facade

use Illuminate\Support\Facades\Auth;

Auth::user()->id;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM