I keep getting route not defined error and if I use url()
I get server can not provide a secure connection error.
I hope I can get some help.
route
change view address
<h4><a href="{{ url('product-show/' .$table_name . '/' .$product->item_id)}}">{{ $product->title }}</a></h4>
OR
use route helper laravel
To call a route by name, you should use the route function and add the parameters in an array as the second parameter.
route('product-show', [$table_name, $product->item_id])
The reason you get a route not defined error is that you are generating the url /product-show/{table_name}/{product_id}
and the actual url is /show/{table_name}/{product_id}
. Also, adding the parameters manually is bad practice when there are many helper functions that do this for you.