A
A
Andrey Fedotov2016-04-26 17:57:55
MySQL
Andrey Fedotov, 2016-04-26 17:57:55

What is the best way to design an application structure on Laravel 5.1?

Hello, now I am working on one of the orders, the structure is similar to www.zoon.ru, it is similar in that each category has different filters. Now the question is before me. How to design such an application? For each category, create your own model and implement links with each of the filters? After all, in order to filter by some criteria, they must be specified when adding from the admin panel. And for different categories you need to fill in different fields in the form. I look forward to your suggestions and advice. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Kainazarov, 2016-04-26
@iit

It's possible, but I myself would use mongodb or postgres + json for these purposes, otherwise it will go to each category according to the table, and this is already quite dreary to implement, eav of course exits if you store the entity as a set of parameters, but nosql or postres + json is suitable for this it is better. Moreover, in the 5x branch, queries were introduced for fields of the json type. As a result, you can create several schemas and filter by parameters in the json schema. Then you can get by with one model but with a bunch of filters.

A
Alex Wells, 2016-04-27
@Alex_Wells

Make the most of Laravel Eloquent. Model for product, category, filter, filter elements. Filters of different types. You connect all this with polymorphs and voula. Well, don't forget to cache it all. Otherwise, no way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question