title: Laravel 5 redirect loop error
body: <p>I trying to make a login and admin script, the problem is that I have a redirect loop I dont know why. </p>
  
  <p>I want the login users and can be in the <code>/</code> path not <code>/home</code>. </p>
  
  <p>If change <code>return new RedirectResponse(url('/'));</code> to <code>return new RedirectResponse(url('/anotherpage'));</code> it works but I want to be <code>/</code></p>
  
  <p><strong>Routes:</strong></p>
  
  <pre><code>    Route::get('/', [
          'as' =&gt; 'home', 'uses' =&gt; 'HomeController@index'
      ]);
  
  
      // Tutorials Routes
  
      Route::get('/tutorials', 'HomeController@tutorials');
      Route::get('/tutorials/{category?}', 'HomeController@tutorialsCategory');
      Route::get('/tutorials/{category?}/{lesson?}', 'HomeController@tutorialsLesson');
  
      // Courses and Series Routes
  
      Route::get('/courses-and-series', 'HomeController@coursesandseries');
  
      // Admin Routes
  
      Route::group(['middleware' =&gt; 'App\Http\Middleware\AdminMiddleware'],                 function()
      {
          Route::get('/admin', function()
          {
              return 'Is admin';
          });
      });
  
      Route::controllers([
          'auth' =&gt; 'Auth\AuthController',
          'password' =&gt; 'Auth\PasswordController',
      ]);
  </code></pre>
  
  <p><strong>Admin middleware:</strong></p>
  
  <pre><code>    public function handle($request, Closure $next)
      {
          if (Auth::user()-&gt;type != 'Admin')
          {
              return abort(404);
          }
  
          return $next($request);
      }
  </code></pre>
  
  <p><strong>RedirectIfAuthenticated:</strong></p>
  
  <pre><code>    public function handle($request, Closure $next)
      {
          if ($this-&gt;auth-&gt;check())
          {
              return new RedirectResponse(url('/'));
          }
  
          return $next($request);
      }
  </code></pre>
  
  <p><strong>Home Controller:</strong></p>
  
  <pre><code>class HomeController extends Controller {
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      public function index()
      {
          return view('home');
      }
  
      public function tutorials()
      {
          return view('pages.tutorials');
      }
  
      public function tutorialsCategory()
      {
          return view('pages.tutorials');
      }
  
      public function tutorialsLesson()
      {
          return view('pages.single');
      }
  
      public function coursesandseries()
      {
          return view('pages.coursesandseries');
      }
  
      public function single()
      {
          return view('pages.single');
      }
  }
  </code></pre>