title: How to use middleware for multiple type of admins in laravel?
body: <p>I am using middleware in laravel. I have two middleware one is admin and second one is commissioner</p>
  
  <p>Now in both middlewares some routes access to both middleware and some are not. Now what happen is i want personal routes of admin middleware not be accessed in commissioner middleware.
  Here i have tried:-</p>
  
  <pre><code>//Admin Middleware Route
  Route::group(["middleware" =&gt; ['admin']], function () {
      Route::match(['get', 'post'], '/admin/users', 'AdminController@users');
  });
  //Commissioner Middleware Route
  Route::group(["middleware" =&gt; ['commissioner']], function () {
   //we can put later on these routes
  });
  
  // common middleware routes between commissioner and admin
  Route::group(["middleware" =&gt; ['admin','commissioner']], function () {
      Route::match(['get', 'post'], '/admin/dashboard', 'AdminController@dashboard');
      Route::match(['get', 'post'], '/admin/profile', 'AdminController@profile');
  });
  </code></pre>
  
  <p>Now when i access the <strong>AdminController@users</strong> route when i login through commissioner it is accessible but i want that route not be accessed in when commissioner login. but <strong>AdminController@dashboard</strong> and <strong>AdminController@profile</strong>  should be accessible in both middleware</p>
  
  <pre><code>When admin login then  type is : master
  when commsioner login then type  is : commissioner
  
  // Commissioner Middleware
  class Commissioner
  {
  /**
   * Handle an incoming request.
   *
   * @param  \Illuminate\Http\Request  $request
   * @param  \Closure  $next
   * @return mixed
   */
  public function handle($request, Closure $next)
  {
      if(empty(Session::has('adminSession'))){
          return redirect()-&gt;action('AdminController@login')-&gt;with('flash_message_error', 'Please Login');
      }
      return $next($request);
  }
  }
  
  // admin Middleware
  class Admin
  {
  /**
   * Handle an incoming request.
   *
   * @param  \Illuminate\Http\Request  $request
   * @param  \Closure  $next
   * @return mixed
   */
  public function handle($request, Closure $next)
  {
      if(empty(Session::has('adminSession'))){
          return redirect()-&gt;action('AdminController@login')-&gt;with('flash_message_error', 'Please Login');
      }
      return $next($request);
  }
  }
  </code></pre>
  
  <p>Please help me i am using laravel 5.2. Thanks in advnace :)</p>