Replies: 1 comment 5 replies
-
From laravel 8 get on a relation:
So after the get() all relations are eager loaded. For what do you need the loaded method?
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be nice if we can check if a relation is loaded on an Eloquent collection. See the following example:
In my use case I'm rendering a table with projects which contains a 'client' column. This column should only be shown if the relation is actually loaded. For each project row I can check this with relationLoaded() but for the table header this isn't possible.
What do you guys think about this one?
Beta Was this translation helpful? Give feedback.
All reactions