Answer the question
In order to leave comments, you need to log in
How to make a selection from the database by field - array in Laravel?
There is a project on Laravel. You need to make a query on the field, which is an array of numbers. That is, I pass 1 number and it is necessary to display all models - records from the database in the field (which is an array) has this number.
Answer the question
In order to leave comments, you need to log in
Use a field to store json , then you can search by content without any problems. Another thing is that this is no longer suitable for more or less serious workloads, and you need to make either a bit mask (if there are not many possible values, up to 64) (or its counterpart with set named values ), or a joined table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question