title: Laravel: ERR_TOO_MANY_REDIRECTS
body: <p>I'm trying to code a basic authentication system in Laravel, its resulting in a redirect loop.</p>
  
  <p>First I just visit the "localhost" domain, it then sends me to /home when I'm not even authenticated and throws the chrome error.</p>
  
  <p>Routes:
      
  
  <pre><code>Route::group(['middleware' =&gt; 'platform', 'namespace' =&gt; 'Ec9'], function() {
  
      Route::group(['prefix' =&gt; 'platform'], function() {
          Route::get('/restricted', ['as' =&gt; 'platform.restricted', 'uses' =&gt; 'PlatformController@getRestrictedView']);
          Route::get('/unlock_route', ['as' =&gt; 'platform.unlock_route', 'uses' =&gt; 'PlatformController@getUnlockRouteView']);
      });
  
      Route::group(['domain' =&gt; 'localhost', 'midleware' =&gt; 'frontend', 'namespace' =&gt; 'Frontend'], function() {
  
          Route::group(['middleware' =&gt; 'guest', 'namespace' =&gt; 'Guest'], function() {
  
              Route::group(['prefix' =&gt; 'setup'], function() {
                  Route::any('/language', ['as' =&gt; 'frontend.guest.setup.language', 'uses' =&gt; 'LandingController@getSetupLanguageView']);
                  Route::any('/welcome', ['as' =&gt; 'frontend.guest.setup.welcome', 'uses' =&gt; 'LandingController@getSetupWelcomeView']);
              });
  
              Route::get('/', ['as' =&gt; 'frontend.guest.landing', 'uses' =&gt; 'LandingController@redirect']);
  
              Route::get('/login', ['as' =&gt; 'frontend.guest.login', 'uses' =&gt; 'LoginController@getLoginView']);
              Route::post('/login', ['as' =&gt; 'frontend.guest.login', 'uses' =&gt; 'LoginController@onLoginPost']);
  
          });
  
          Route::group(['middleware' =&gt; 'auth', 'namespace' =&gt; 'User'], function() {
              Route::get('/home', ['as' =&gt; 'frontend.guest.login', 'uses' =&gt; 'HomeController@getHomeView']);
  
              Route::group(['prefix' =&gt; 'account'], function() {
                  Route::get('/logout', ['as' =&gt; 'frontend.user.account.logout', 'uses' =&gt; 'AccountController@logout']);
                  Route::get('/settings', ['as' =&gt; 'frontend.user.account.settings', 'uses' =&gt; 'AccountController@getAccountSettingsView']);
              });
          });
  
      });
  
  });
  </code></pre>
  
  <p>LandingController:</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers\Ec9\Frontend\Guest;
  
  use App\Http\Controllers\Controller;
  use Redirect;
  use Auth;
  
  class LandingController extends Controller
  {
      public function redirect() {
          if (Auth::check()) {
              return redirect()-&gt;route('frontend.user.home');
          }
  
          return redirect()-&gt;route('frontend.guest.login');
      }
  }
  </code></pre>
  
  <p>And the LoginController and HomeController functions just return the views, I thought it was just spamming the question with code too much if I posted the whole class, so I just explained what it did to paint a picture</p>