Strange behaviour of Laravel Package binding - ModelNotFoundException when model exists and binding is set #35264
Unanswered
roncakjakub
asked this question in
Q&A
Replies: 0 comments
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.
-
I recently started to test my new api in Laravel Phpunit for book management, but when I wanted to update the book with id of created book like that:
I get this error
When i put there id of non-existing model I got a little different message
Mainly I don't understand, why it tries to bind whole object when I insert only id.
Model, controller and routes for book managing are in custom package and routes have api middleware set.
My controller method:
My routes
My route service provider:
What makes it even more strange is, when I call show method
I am able to bind Book model.
Sorry for my english.
Beta Was this translation helpful? Give feedback.
All reactions