A
A
Andre972021-06-29 13:40:24
Laravel
Andre97, 2021-06-29 13:40:24

Can I somehow check in the query whether the value is in the array, which is written in the table?

Hello. In one of the columns of the table, there is an array of the form

{"query":"true","city_id":["4","5","6"],"country":["2"]}

The city_id value comes in. In the view query constructor, ->where('a', 'b');you can somehow check whether this incoming value falls into this array, by the key city_id?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jazzus, 2021-06-29
@Andre97

https://laravel.com/docs/8.x/queries#json-where-clauses

P
pLavrenov, 2021-06-29
@pLavrenov

Rule - Exists

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question