I have method in my controller (singleProduct):
public function singleProduct($slug)
{
$product= Product::where('slug','=', $slug)->first();
return view('public.product.show')->withProduct($product);
}
And my route is:
Route::get('/{category}/{slug}',['as' => 'single.product', 'uses' => 'LinkController@singleProduct']);
My code in view:
<a href="{{ route('single.product', $product->category, $product->slug) }}">{{$product->title}}</a>
Though i have passed both required parameter for route.My route is returning an error of:
Missing required parameters for [Route: single.product] [URI: {category}/{slug}].