laravel use a guard for authentication code example Example 1: get user auth in laravel Auth::user(); Example 2: laravel setup auth // Laravel 5.x php artisan make:auth