title: Laravel Hide ID from url
body: <p>I want to hide <code>id</code> from <code>URL</code>, I have database table that contains <code>store_id</code>, <code>store_name</code>, <code>store_city</code> and <code>store_zipcode</code> fields, now its working like this:</p>
  
  <p><code>http://example.com/store/1/Cafe-Crsip-Chicago-60640</code></p>
  
  <p>But I want it to change like this:</p>
  
  <p><code>http://example.com/store/Cafe-Crsip-Chicago-60640</code></p>
  
  <p>without showing <code>id</code> in <code>URL</code>.</p>
  
  <p><strong>ROUTE:</strong></p>
  
  <pre><code>Route::get('store/{id}/{slug}',['as'=&gt;'showProducts','uses'=&gt;'FrontController@getProduct']);
  </code></pre>
  
  <p><strong>HREF:</strong></p>
  
  <pre><code>&lt;a href="store/{{$store-&gt;store_id}}/{{str_replace(' ', '-', $store-&gt;store_name)}}-{{str_replace(' ', '-', $store-&gt;store_city)}}-{{$store-&gt;store_zipcode}}"&gt;
  </code></pre>
  
  <p><strong>CONTROLLER:</strong></p>
  
  <pre><code> public function getProduct(int $id, string $slug)
   {
    $products = Product::where(['store_id'=&gt;$id])
      -&gt;orderBy('category_id', 'asc')
      -&gt;with('category','relatedproducts', 'relatedproducts.product')
      -&gt;get()
      -&gt;groupBy('category_id');
   }
  </code></pre>
  
  <p><strong>Please note</strong> that Im using str_replace to remove any spaces in url so if  I used store/{slug} the parameters from url will not be the same if I modified the url using str_replace</p>