title: Laravel 5.3 - Internal redirect or modify request middleware
body: <p>I am building an API with Laravel 5.3. I have routes such as <code>/users/1</code>, <code>users/1/teams</code> etc.</p>
  
  <p>I'd like client applications to also be able to use URIs like <code>/users/self</code>, <code>/users/self/teams</code>.</p>
  
  <p>I was looking into building a middleware that checks to see if <code>/self/</code> is in the request URI and if it is, then change <code>/self/</code> to the user's actual id, or do an internal redirect to the requested endpoint.</p>
  
  <p>Any ideas on how I could do this?</p>