title: Laravel route group parameters
body: <p>I want an app to use a URL structure something like this:</p>
  
  <ol>
  <li><code>/account/johnsmith/photos</code> </li>
  <li><code>/account/johnsmith/messages</code></li>
  <li><code>/account/johnsmith/settings</code></li>
  <li><code>/account/joebloggs/photos</code></li>
  </ol>
  
  <p>So users may add multiple accounts and then the route group selects the account automatically. </p>
  
  <pre><code>Route::group(['middleware' =&gt; 'auth', 'prefix' =&gt; 'account/{username}'], function () {
    Route::get('/photos', 'PhotosController@index')-&gt;name('photos.index');
  });
  </code></pre>
  
  <p>In the above example I can access the <code>{username}</code> parameter inside of <code>PhotosController@index</code>. </p>
  
  <p>Is there a way to write some middleware that gets the account information automatically and it's accessible to all child routes in the group? Or am is this a bad way to try to build this? </p>