You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a REST API my approach to create dependent resources (e.g. deliveries to an order) is to register a Resource Route like this (stripped for brevity):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
For a REST API my approach to create dependent resources (e.g. deliveries to an order) is to register a Resource Route like this (stripped for brevity):
So a delivery could be created by POSTing to /api/orders/123456/deliveries
This fails to call the $missing if the order does not exist because the option is unset in \Illuminate\Routing\ResourceRegistrar in addResourceStore.
The current solution is
But this becomes more verbose if there are many API routes, and programmers are lazy...
Is there any way to use Resource Routes?
Beta Was this translation helpful? Give feedback.
All reactions