title: Laravel - How to use the Advanced Routing properly
body: <p>I have a book list which are in categories and subcategories.</p>
  
  <p>Every category hasMany Subcategories. And every subcategory belongsTo a category in my Models.</p>
  
  <p>Now I want to have <strong>routes</strong> like this:</p>
  
  <p>books/{category?}</p>
  
  <p>and</p>
  
  <p>books/{category?}/{subcategory?}</p>
  
  <p>my <strong>Routes</strong> look like this:</p>
  
  <pre><code>Route::resource('categories', 'ReligionsController');
  
  Route::resource('category/{category?}', 'ReligionBranchController');
  
  Route::get('category/{category?}/{subcategory?}', function()
  {
      return 'Quitter never win';
  });
  </code></pre>
  
  <p>Now the Problem is, that my 2nd route works perfectly find, with my ReligionBranchController, but my last route (3rd) isn't working at all and I get this message:</p>
  
  <pre><code> Route pattern "/categories/{category}/{{category}}" cannot reference variable name "category" more than once.
  </code></pre>
  
  <p>How am I going to use dynamic routes like this:</p>
  
  <pre><code> example.org/category/fear/thriller
   example.org/category/love/drama
   example.org/category/love/science-fiction
  </code></pre>
  
  <p>Hope someone understands my trouble.</p>