Support the ongoing development of →
Database Eloquent
Last updated 1 year ago.

In Illuminate\Database\Eloquent\Collection, there is a Collection::make() method that did exactly what I needed.


Collection::make() won't give you a collection of eloquent models, though. You could just use the hydrate or hydrateRaw method on your Item model. That'll give you a collection of models.


yeah, hydrateRaw actually looks like it could be a shortcut to the way I did it. thanks for pointing that out.

Last updated 9 years ago.

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.