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

If every asset will be linked to only one parent lesson, and every lesson will be linked to only one course, then all of your relations are one-o-many Check the official documentation here: https://laravel.com/docs/master/eloquent-relationships#one-to-many And don't forget to define the inverse relations as well.

0

either use eloquent relationships or use inner join's in mysql via DB::query

0

Sign in to participate in this thread!

Eventy

Your banner here too?

sajeeshe sajeeshe Joined 18 Mar 2016

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.