Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

It looks like Shows is a collection from your example, so if you access one of them, you can then get though to the episodes method. You can't access all of the episodes directly like your example.

For example, this below will get the episodes for the first show.

App\User::find(1)->shows->first()->episodes
0

Sign in to participate in this thread!

Eventy

Your banner here too?

viiter viiter Joined 4 Nov 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.

© 2024 Laravel.io - All rights reserved.