S
S
Slavik2022-01-10 10:37:07
PHP
Slavik, 2022-01-10 10:37:07

What is the best way to output quantity in filters in Laravel?

Hello!
For example, such a filter 61dbe0607dcfa854597960.png
. What is the best way to display the quantity in this filter?
$countFirst = $data->where('entity', '>=', $n)->count(); and then pass $countFirst to the template for each checkbox or selectRaw
What is the best way to do it, won't these requests slow down the page a lot?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2022-01-10
@Makro_Slavik

This is called facet search and is implemented differently. For this phrase, you will find many instructions, including ready-made packages for Laravel - choose what you like.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question