I
I
Ilya2018-05-19 11:01:39
Laravel
Ilya, 2018-05-19 11:01:39

How to make such chic CNC for filters in the catalog?

Welcome all.
Often, no one bothers what will happen in the URL after site.ru/catalog/category (figuratively), when the user presses the filter inputs and the filter button, for example, but on this site the guys got confused =). Look at examples of urls filtered by some characteristics:
1. poe.trade/search/inariteriosius - few items selected
2. poe.trade/search/oremaumihahasi - many items selected
3. poe.trade/search/imomasikosakom - just another url for example
Do not pay attention to the subject of the site =)
How do systems understand such URLs? Is it possible to teach this to Laravel 5.4 (not necessarily just with such filter url codes). How can this be done at all? At least the principle.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2018-05-19
@alexey-m-ukolov

You just need to match the query parameters with a unique string in some storage (DB or Redis, for example). When a request is received, we get the parameters from the store, instead of request()->get('foo') and work with them as usual.

D
D3lphi, 2018-05-19
@D3lphi

I'm afraid to ask, what's so great about it? What's after poe.trade/search/ is just the id of the search query they have somewhere. When the search parameters are changed, a record is created, for example, in the database in which all these parameters are stored. Sending all this as a GET request is not very good, since there are a lot of different parameters for filtering. When following a link, a record with the received identifier from the url is obtained from the storage and filtering is performed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question