Support the ongoing development of Laravel.io →
Configuration Views Blade
Last updated 2 years ago.
0

Instead of @foreach ($artifacts as $artifact) change it to @foreach ($artifacts->get() as $artifact)

Last updated 2 years ago.
0
Solution

matthewburrow said:

Instead of @foreach ($artifacts as $artifact) change it to @foreach ($artifacts->get() as $artifact)

It's better to keep as much logic out of your views, this is a better solution

return View::make('index', array('artifacts' => Artifact::with('product')->get()));
Last updated 2 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.