title: Laravel request helper in URL to get ID / Resource ID
body: <p>I'm working on a Laravel 5.6 app and have the following two API routes:</p>
  
  <pre><code>Route::resource('/partners', 'API\Partners\PartnersController');
  
  Route::resource('/partners/{id}/sales-team', 'API\Partners\SalesTeamController');
  </code></pre>
  
  <p>In both of the controllers I am referencing a custom middleware 'VerifyUserOwnsTeam' in the construct method.</p>
  
  <p>To get the resource ID from the request in the middleware I previously had:</p>
  
  <pre><code>$request-&gt;route('partner')
  </code></pre>
  
  <p>This worked a URL such as: </p>
  
  <pre><code>/api/partners/1
  </code></pre>
  
  <p>However, I am now calling a new end point such as:</p>
  
  <pre><code>/api/partners/1/sales-team
  </code></pre>
  
  <p>In my middleware the request route param for partner is null. If I change the reference to be:</p>
  
  <pre><code>$request-&gt;route('id')
  </code></pre>
  
  <p>Then it works for the latter endpoint, but fails on the first for a null value.</p>
  
  <p>Any idea how to get this consistent?</p>