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

No one? Or can someone guide me to the solution if there is a function for these kind of tasks. I'm quite new to this...

Last updated 2 years ago.
0

I would just create a view for the scores, corresponding model, and make a relationship linking User and Score, if you want to leverage Eloquent features like eager loading etc.

Last updated 2 years ago.
0

Thanks Jarektkaczyk. But I don't really understand how a Score view could help me here. Do you mean Model or Migration? View in my world is just a sheet of html and blade. Eager loading seems like a good way to start, but I'm still struggeling with the Person model to achieve it correctly

Last updated 2 years ago.
0

By VIEW I mean MySQL view (or any other db you use). for this is the place to handle such things. Eloquent is not the right tool for complex relations between tables, but when you do it on db part, then you can leverage Eloquent models like usually.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Hambern hambern Joined 22 Dec 2013

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.