title: Laravel 5.4 routing for same prefix group but different middleware giving error
body: <p>I need all the route under same prefix <strong>manager</strong> with one middleware for guest <strong>manager_guest</strong> and another for logged in user <strong>manager_auth</strong>.
  This code bellow is my route web.php file.</p>
  
  <p>Is there any other way ?</p>
  
  <p>My routes:</p>
  
   
  
  <pre><code>Route::prefix('manager')-&gt;group(['middleware' =&gt; 'manager_guest'], function () {
      Route::get('/register', 'Manager\RegisterController@showRegister')-&gt;name('manager.register.create');
      Route::post('/register', 'Manager\RegisterController@register')-&gt;name('manager.register.store');
      Route::get('/login', 'Manager\LoginController@showLogin')-&gt;name('manager.login.create');
      Route::post('/login', 'Manager\LoginController@login')-&gt;name('manager.login');
  });
  
  Route::prefix('manager')-&gt;group(['middleware' =&gt; 'manager_auth'], function () {
      Route::post('/logout', 'Manager\LoginController@logout')-&gt;name('manager.logout');
      Route::get('/profile', 'Manager\PageController@profile')-&gt;name('manager.profile');
  });
  </code></pre>
  
  <p>Error after executing <code>php artisan route:list</code></p>
  
  <pre class="lang-none prettyprint-override"><code>PHP Warning: Uncaught ErrorException: Array to string conversion in E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\Router.php:329
  Stack trace:
  #0 E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\Router.php(329): Illuminate\Foundation\Bootstrap\HandleExceptions-&gt;handleError(8, 'Array to string...', 'E:\\laragon\\www\\...', 3
  29, Array)
  #1 E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\Router.php(329): require()
  #2 E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\Router.php(285): Illuminate\Routing\Router-&gt;loadRoutes(Array)
  #3 E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\RouteRegistrar.php(104): Illuminate\Routing\Router-&gt;group(Array, Array)
  #4 E:\laragon\www\laraveladmin\routes\web.php(30): Illuminate\Routing\RouteRegistrar-&gt;group(Array, Object(Closure))
  #5 E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\Router.php(329): require('E:\\laragon\\www\\...')
  #6 in E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate\Routing\Router.php on line 329
  PHP Fatal error:  Illuminate\Routing\Router::loadRoutes(): Failed opening required 'Array' (include_path='E:\Developer\Wbserver\php\PEAR') in E:\laragon\www\laraveladmin\vendor\laravel\framework\src\Illuminate
  \Routing\Router.php on line 329
   
  [Symfony\Component\Debug\Exception\FatalErrorException] Illuminate\Routing\Router::loadRoutes(): Failed opening required 'Array' (include_path='E:\Developer\Wbserver\php\PEAR')
  </code></pre>