N
N
nicolaa2020-12-11 11:23:23
SQL
nicolaa, 2020-12-11 11:23:23

How to do a search on laravel?

There are goods, goods have characteristics, characteristics are stored in the goods table in the `fields` column type - JSON ("characteristic id":"Characteristic value")

id | title | fields
1 | Product 1 | {"1":"Wall"}
2 | Product 2 | {"1":"Concrete wall"}
3 | Product 3 | {"1":"Painted concrete wall"}

For example, when we search for:

1) By the characteristic `Wall` - we get all goods in response
2) By the characteristic `Concrete wall` - we receive in response goods with `id`: `2, 3`
3) According to the characteristic `Concrete painted wall` - we receive in response goods with `id`: `3`

I hope I explained it well)

I have 0 in my head, which way to go,

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2020-12-11
@nicolaa

Where Like

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question