title: Laravel redirect based on role - spatie/laravel-permission
body: <p>I am using this package <a href="https://github.com/spatie/laravel-permission" rel="nofollow noreferrer">spatie/laravel-permission</a> and what I want to do is:</p>
  
  <p>super-admin, admin, members have the same login and after logged in it redirect to different routes.
  The super-admin and admin have the same redirect. So I put this code.</p>
  
  <pre><code>//app\Http\Controllers\Auth\LoginController.php
  protected function authenticated(Request $request, $user)
  {
      if ( $user-&gt;hasAnyRole(['super-admin', 'admin']) ) {// do your margic here
          return redirect()-&gt;route('admin.dashboard');
      }
  
       return redirect('/home');
  }
  </code></pre>
  
  <p>and then this is my routes
  //routes/web.php</p>
  
  <pre><code>Auth::routes();
  Route::group(['middleware' =&gt; ['role:member']], function () {
      Route::get('/', 'HomeController@index')-&gt;name('home');
  });
  Route::group(['middleware' =&gt; ['role:super-admin|admin'], 'prefix' =&gt; 'admin'], function () {
      Route::get('/', 'Admin\HomeController@dashboard')-&gt;name('admin.dashboard');
  });
  </code></pre>
  
  <p>After login, what I want to do is when a <strong>super-admin</strong>/<strong>admin</strong> visit the <code>site.com/*</code> it should redirect to <code>site.com/admin/</code> cause he is not authorize cause he is not a <em>member</em> and also when a <em>member</em> visit the <code>site.com/admin/*</code>, he redirect to <code>site.com/</code> cause he is not <em>admin/super-admin</em>, the rest will go to login page when not authenticated.</p>
  
  <p>It displays like this,
  <img src="https://user-images.githubusercontent.com/5249781/50538926-f55b5b00-0bb2-11e9-861b-f290d4ce958e.png" alt="image"></p>
  
  <p>It should redirect based on their role homepage instead display 403 error.</p>