Answer the question
In order to leave comments, you need to log in
How to implement product filtering in Laravel?
Hello.
I am developing a light online store on Laravel 5.1
I have not come across this framework before (I just started learning).
The database has the following tables:
products
id, name, category_id, brand_id, min_price, max_price
categories
id, slug, name
brands
id, slug, name, logo
products_filters
id, slug, name, dimension
products_filters_values
id, filter_id, product_id, value
Answer the question
In order to leave comments, you need to log in
There will be something like
Products::has('brands', function($query) {
$query->where('id', \Input::get('brandId'));
});
If I understood correctly, then you need a faceted search, it is available in Sphinx.
https://github.com/adriannuta/SphinxFacetingExample
Demo - sphinxdemos.adriannuta.com/SphinxFacetingExample
You do not be offended, but in your case it is enough to devote an hour or two to documentation on eloquent'u. If it's too complicated, it's better to give the project to someone who understands what they're doing - you shouldn't spoil the life of your colleagues with shitty code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question