I send an array to my API made in Laravel 5 which is an array of allowed values ex: [1,3,5]
I try to do the select like this:
$json = (object)Input::all();
$loans = DB::table("loans")
->where("years", ">=", $json->year_low)
->where("years", "<=", $json->year_high)
->where("risk", $json->risks)
->get();
risks is the array.
What I receive from the database is and empty array.
In a test I send every possible value 0...4 but I receive an empty array.
How can I select a row which a column's value exists inside an array?
whereIn()perhaps?