title: Laravel 5 Route Chaining Multiple Models/Controllers
body: <p>I am new to laravel and want to ask how can I setup the route of my website. Using route resource I'll get the URIs like this.</p>
  
  <pre><code>http://www.example.com/products // List all the products
  http://www.example.com/products/create // Display a form to create a product
  ...
  And so on...
  </code></pre>
  
  <p>What I was trying to accomplish is, when I visit a single product and click its category my route should look like this:</p>
  
  <pre><code>http://www.example.com/products/{slug}/category/{slug}
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>http://www.example.com/{productsSlug}/{categorySlug}
  </code></pre>
  
  <p>My routes.php</p>
  
  <pre><code>&lt;?php
  
  Route::get('home', 'PagesController@home');
  
  Route::resource('products', 'ProductsController');
  Route::resource('categories', 'CategoriesController');
  </code></pre>