title: Laravel routing varying
body: <p>I have a categories table that looks like this:</p>
  
  <pre><code>-- id   -- parent_id             -- name
      1             0              electronics
      2             1              Televisions
      3             2             LCD TVs
      4             2             Plasma Tvs
      5             1              DVD Players
      6             1              Bluray Players
      7             0             Home Appliances
      8             7            Cookers
      9             7            Fridges &amp; Freezers
      10            0            Fashion
      11            10            Mens Clothing
      12            11             Shirts
      13            10            Womens Clothing
      14            13            Skirts
  </code></pre>
  
  <p>and so on - the problem I have is some categories are only single and others can be 3 or 4 deep.</p>
  
  <p>I have a list page that will paginate all items in a given category and will show the child categories of that category for further drilling down and so on until the last child is reached.</p>
  
  <p>I have 2 problems 1 being how do I route this so it will match /products/{parent_category}/?if_exists_child_category/if_exists_child_child/if_exists_child_child_child</p>
  
  <p>the next is on the home page I have featured products and need to link to the product page and include the full category path to it product/parent_cat/if_exists_sub_cat/if_exists_sub_sub_cat/if_exists_sub_sub_sub_cat/product_name * I have an idea how to do this one the routing issue is my main problem.</p>
  
  <p>or even if I could just capture everything after prodocucts/ I could then explode it into an array and cycle through the categories and or find the product slug and display the correct view.</p>
  
  <p>Thanks All in advance and Happy Almost Christmas :)     </p>