Support the ongoing development of Laravel.io →
Eloquent Views

I have the following tables set up

widgets table: id, name, widget_types_id

widget_types table: id name

I have a query that pulls the widgets. I want to display the data like this:

Widget Type # 1: widget types name # 1 widget types name # 2 widget types name # 3

Widget Type # 2: widget types name # 1 widget types name # 2 widget types name # 3

What would be the best way to do this? Thanks

Last updated 3 years ago.
0

I realized I should have been doing this differently and got it working using the relationships.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

tpbsv77 tpbsv77 Joined 12 Mar 2014

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.

© 2025 Laravel.io - All rights reserved.