Logged in user(admin) getting Auth::guest() : true in Laravel 5.2
<p>I'm implementing user and admin login function with different routes.
I just modified user routes to make admin routes. </p>

<p><strong>My routes.php</strong> </p>

<pre><code>Route::get('/', function () { return view('welcome');

Route::group([ 'prefix' =&gt; 'admin', // "namespace" =&gt; ], function() {
  Route::get('/login', 'AdminAuthController@showLoginForm');
  Route::post('/login', 'AdminAuthController@login'); 
  Route::get('/logout', 'AdminAuthController@logout'); 
  Route::get('/home', 'AdminHomeController@index'); 
  });

php artisan route:list

|        | GET|HEAD | admin/home                   |                      | App\Http\Controllers\AdminHomeController@index                  | web,auth:admin  |
|        | POST     | admin/login                  |                      | App\Http\Controllers\AdminAuthController@login                  | web,guest:admin |
|        | GET|HEAD | admin/login                  |                      | App\Http\Controllers\AdminAuthController@showLoginForm          | web,guest:admin |
|        | GET|HEAD | admin/logout                 |                      | App\Http\Controllers\AdminAuthController@logout                 | web             |
|        | GET|HEAD | home                         |                      | App\Http\Controllers\HomeController@index                       | web,auth:user   |
|        | GET|HEAD | login                        |                      | App\Http\Controllers\Auth\AuthController@showLoginForm          | web,guest:user  |
|        | POST     | login                        |                      | App\Http\Controllers\Auth\AuthController@login                  | web,guest:user  |
|        | GET|HEAD | logout                       |                      | App\Http\Controllers\Auth\AuthController@logout                 | web             |
|        | POST     | password/email               |                      | App\Http\Controllers\Auth\PasswordController@sendResetLinkEmail | web,guest       |
|        | POST     | password/reset               |                      | App\Http\Controllers\Auth\PasswordController@reset              | web,guest       |
|        | GET|HEAD | password/reset/{token?}      |                      | App\Http\Controllers\Auth\PasswordController@showResetForm      | web,guest       |
|        | GET|HEAD | register                     |                      | App\Http\Controllers\Auth\AuthController@showRegistrationForm   | web,guest:user  |
|        | POST     | register                     |                      | App\Http\Controllers\Auth\AuthController@register               | web,guest:user  |
</code></pre>

<p>I added admin guard.</p>

<p>Now I can login as user and admin but when I am in home view I still get Auth::guest => true. So I can't exactly get the view that I want.</p>

<pre><code>app.blade.php
...
@if (Auth::guest())
         &lt;li&gt;&lt;a href="{{ url('/login') }}"&gt;Login&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="{{ url('/register') }}"&gt;Register&lt;/a&gt;&lt;/li&gt;
@else
         &lt;li class="dropdown"&gt;
           &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"&gt;
                 {{ Auth::user()-&gt;name }} &lt;span class="caret"&gt;&lt;/span&gt;
           &lt;/a&gt;

           &lt;ul class="dropdown-menu" role="menu"&gt;
                &lt;li&gt;&lt;a href="{{ url('/logout') }}"&gt;&lt;i class="fa fa-btn fa-sign-out"&gt;&lt;/i&gt;Logout&lt;/a&gt;&lt;/li&gt;
           &lt;/ul&gt;
         &lt;/li&gt;
@endif
....
</code></pre>

<p>is there any way to solve this?</p>