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

I'm really not sure what you are trying to accomplish. If you only have one Piano in your Instruments table you can use the method ->first() instead of ->get() and you will get the object representing that row and use it like you do now (without the foreach part) in your view.

If you want to get all instruments in your table simply do Instrument::all() and you get all of them and can cycle through them in a foreach loop.

0

paginate ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Asumii asumii Joined 22 Nov 2015

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.