Is solution for this in Eloquent ORM?
I have array with parents idetifiers:
Array ( [0] => 87, [1] => 65, ... )
And i want select table PRODUCTS where parent_id column = any id in array
Fluent:
DB::table('PRODUCTS')->whereIn('parent_id', $parent_ids)->get();
Eloquent:
Product::whereIn('parent_id', $parent_ids)->get();
Your array must be like this :
$array = array(87, 65, "etc");
Product::whereIn('parent_id', $array)->get();
or
Product::whereIn('parent_id', array(87, 65, "etc"))->get();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With