I want to get the slug of a product but as part of that I am performing a query to get some data related to the product form another table. This is how am displaying my product in my .blade view;
<form action="{{ route('user.showProduct', $productProductOption->product->slug) }}" method="GET">
<input type="hidden" value="{{ $productProductOption->id }}" name="productProductOption_id">
<a class="goToSingleProduct" href="javascript:void(0)" type="submit">
<img class="img-responsive"
src="{{ $productProductOption ? $productProductOption::display($resultsProductImages[$i]) :asset('assets/theme/images/latest-product.jpg') }}" alt="" width="270" height="350"/>
<?php $i+=1; ?>
</a>
</form>
This is how my controller looks like:
public function show(Request $request, $slug)
{
$product = \App\Product::where('slug', $slug)->firstOrFail();
$productProductOption = ProductProductOption::findOrFail($request->request->get('productProductOption_id'));
}
Anytime I click on a product to view its detail on the next page I get something like http://127.0.0.1:8000/product/freelance-top?productProductOption_id=24.
But I want to instead get http://127.0.0.1:8000/product/freelance-top in the url
Please kindly help me fix this.