Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

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

0

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.

0

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.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.