I have table name details having contains field which stores array in postgres.
id | contents
1 | ["1", "2", "5"]
2 | ["4", "2", "10"]
3 | ["3", "5"]
If I query 5 it should return 2 records i.e. id 1 and 3
I actually want to implement in laravel.
Details::whereRaw("contents ->> $id")->get(); // this doesn't work :p
How to raw query ?