get auth guard user laravel code example
Example 1: laravel auth user_id
$userId = Auth::id();
Example 2: laravel check auth
use Illuminate\Support\Facades\Auth;
if (Auth::check()) {
// The user is logged in...
}
Example 3: laravel setup auth
// Laravel 5.x
php artisan make:auth