Answer the question
In order to leave comments, you need to log in
How to set a route in laravel if the number of options is unknown?
Good afternoon.
There are an unlimited number of categories. If the post is placed in a child category, then the address should be of the form: site.ru/parent_category/....children.../that_child_in_which_post/post
As you understand, these "....children...." can be unlimited amount. According to the TK, there are only 3 levels, but we know that :)
So how to make such a route? Thanks to.
Answer the question
In order to leave comments, you need to log in
I explicitly formed the route /a/b/c/ for "post" and wrote it to the database.
then all "incomprehensible" URLs were simply checked by database
This is how it turns out: you write a specific technical specification, but the performer "knows something" and instead of the required one tries to cut some kind of universal solution that does not even know how to solve it.
Do it according to TK
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question