samedi 17 août 2019

How to create Url that contain name and id laravel

I'm trying to make a product url have id and name like, http://127.0.0.1:8000/productDetail/23/walking shoes. Previously the url was showing only the product id, I have tried to follow some sources online and I'm stuck with this error A non-numeric value encountered how can I make the url contains both product id and name?

 <a href="">

Route

   Route::get('/productDetail/{id}/{pro_name}', 
  'HomeController@detailPro');

Controller

   public function shop()
   {
    $products=product::with('ProductsPhoto')->paginate(2);
    return view('front.shop',compact('products'));
   }



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2z6vaO5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire