-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
How can I add this relation to my resource to only show it when it's loaded?
I have this pivot between Module
And File
with an added language_id
to this pivot
'pivot' => $this->whenPivotLoaded('module_file', fn () => [
'sequence' => $this->pivot->sequence,
'language_id' => $this->pivot->language_id,
'language_code' => $this->whenLoaded('language', $this->pivot->language->code), // Doesn't show
'language_code' => $this->pivot->whenLoaded('language', $this->pivot->language->code), // Error
'language_code' => $this->whenPivotLoaded('language', $this->pivot->language->code), // Doesn't show
]),
The Language
relation doesnt even show when I just use
'pivot' => $this->whenPivotLoaded('module_file', $this->pivot),
'pivot' => $this->whenPivotLoaded('module_file', fn () => $this->pivot),
How would this work?
Metadata
Metadata
Assignees
Labels
No labels