laravel auth guards code example
Example 1: laravel auth user_id
$userId = Auth::id();
Example 2: laravel auth
//laravel 8.x
//for bootstrap scafolding
php artisan ui bootstrap --auth
$userId = Auth::id();
//laravel 8.x
//for bootstrap scafolding
php artisan ui bootstrap --auth