Replies: 1 comment
-
For anyone looking for the answer to this. One is supposed to extend Orion\Http\Controllers\RelationController (not Controller) for controllers associated with relations. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys, I ran into something recently that maybe someone could help me figure out.
I have
Job
andTask
, where Job hasMany Tasks.I added a controller like this:
And registered it in
api.php
like this:But I found the API responses are giving me Jobs rather than Tasks? (at this endpoint:
https://96d3-216-237-193-16.ngrok-free.app/api/jobs/14170/tasks/search
)But when I switch the
$model
and$relation
properties, like this:... then it works?
But it doesn't seem like this is exactly the right answer either, so I'm a little bit confused. Is there anything obvious I'm messing up here?
Thank you for checking this out!
Beta Was this translation helpful? Give feedback.
All reactions