-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eloquent API Resource with loaded relation #642
Comments
What strategy are you using? The Api Resource strategy does not execute your code, and so does not know of those conditions. |
We could potentially add a |
awaiting, thanks |
This is now supported in Scribe 🙂. |
I used the whenLoaded for load the relation in Resources, but the apidoc:generate don't load the relations and don't load the resource correctly:
return [ 'id' => $this->id, 'contacts' => $this->whenLoaded('contacts', function(){ return ContactResource::collection($this->contacts); }), ];
The text was updated successfully, but these errors were encountered: