@
@
@Meight2021-06-23 12:35:45
Laravel
@Meight, 2021-06-23 12:35:45

Why do I get a link with a get request instead of a link via route?

I'm trying to create a button that takes the name of the category and the product itself from the database, the link is like:
site/product_category/product_self
Here's how I tried to implement it:

{{ route('product', [$product->category->code, $product->code]) }}

But for some reason, when I pass parameters through the route, I get a link like:
site / product_category? product_self
Why do I get not a link but a link with get request parameters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-06-23
_

Because your route has only one parameter for the category code, and the second parameter is not there, so Laravel adds it as a get.
Perhaps you have two routes and you incorrectly specify the name of the desired one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question