That's simple. Use findMany
:
$models = Model::findMany([1, 2, 3]);
By the way, you can also pass an array to find()
and it will internally call findMany
:
$models = Model::find([1, 2, 3]);
Under the hood it just does a whereIn
so you could do that too:
$models = Model::whereIn('id', [1, 2, 3])->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