title: Laravel Route::group[] not working correctly
body: <p>I have routes that I would like to group by name, prefix, and middleware together. For some reason, the 'name' option of the Route::group function is not trailing names correctly. Is my code incorrect, or is this a bug? Below is the route group definition.</p>
  <pre class="lang-php prettyprint-override"><code>Route::group(['name' =&gt; 'admin.', 'prefix' =&gt; 'admin',
      'middleware' =&gt; 'admin'], function () {
      Route::get('/', function () {
          return 'the index page';
      })-&gt;name('index');
  
      Route::get('/another', function () {
          return 'another page';
      })-&gt;name('another');
  });
  </code></pre>
  <p>Then I cleared and cached the routes. Here's the list.</p>
  <pre><code>+--------+----------+------------------------+-----------------------------+------------------------------------------------------------------------+------------+
  | Domain | Method   | URI                    | Name                        | Action                                                                 | Middleware |
  +--------+----------+------------------------+-----------------------------+------------------------------------------------------------------------+------------+
  |        | GET|HEAD | admin                  | index                       | Closure                                                                | web        |
  |        |          |                        |                             |                                                                        | admin      |
  |        | GET|HEAD | admin/another          | another                     | Closure                                                                | web        |
  |        |          |                        |                             |                                                                        | admin      |
  </code></pre>
  <p>I am expecting to see in names admin.index, admin.another,...</p>
  <p>However, if I use the Route::name function, it will work correctly.</p>
  <pre class="lang-php prettyprint-override"><code>Route::name('admin.')-&gt;group(function () {
      Route::prefix('admin')-&gt;group(function () {
          Route::middleware('admin')-&gt;group(function () {
              Route::get('/', function () {
                  return 'the index page';
              })-&gt;name('index');
  
              Route::get('/another', function () {
                  return 'another page';
              })-&gt;name('another');
          });
      });
  });
  
  +--------+----------+------------------------+-----------------------------+------------------------------------------------------------------------+---------------+
  | Domain | Method   | URI                    | Name                        | Action                                                                 | Middleware    |
  +--------+----------+------------------------+-----------------------------+------------------------------------------------------------------------+---------------+
  |        | GET|HEAD | admin                  | admin.index                 | Closure                                                                | web           |
  |        |          |                        |                             |                                                                        | admin         |
  |        | GET|HEAD | admin/another          | admin.another               | Closure                                                                | web           |
  |        |          |                        |                             |                                                                        | administrator |
  </code></pre>