Support the ongoing development of Laravel.io →
Laravel

Let's say we have three models Class, Students and Studentinfo. Class and students are in One to Many and Sudents and studentinfo are in one to one. So while getting students from certain Class I get a list of data in an array. Now, what is the best way to get data from studentinfo from each student in the arrray? P.S.(I am trying to get these datas in json format.)

Last updated 3 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.

© 2025 Laravel.io - All rights reserved.