the route for delete and update have a URL parameter section
the route works perfectly when supplied with the proper ID, but when I manually supply a wrong ID (one that doesn't exist in the DB). it would show me a 404 page (which is the expected behaviour), I searched the docs and found the "missing" method and applied it as above, but now instead of redirecting it back I get an error
The course-info-sections method is not supported for route PATCH. Supported methods: GET, HEAD, POST.
I tried to dd("Not Found") in the closure of the missing method, and that works.
Long story short, the workaround found by Sinnbeck was to change the order of middleware in Kernel.php, I did that and the problem is solved
here is his reply
Got it working :D
It depends on the order of your middleware in your Kernel.php. The inertia middleware MUST come before the SubstituteBindings
This doc says to put it last, but that means it wont work with this. https://inertiajs.com/server-side-setup#middleware
I cannot guarantee that it does not give other issues
he mentions that he's unsure if changing the order could break other functionalities, as inertia docs asks to put the inertia middleware at the very end.
We're closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this problem.
Hi,
So I came across this issue and posted it on laracasts forums.
I'm creating an app with Inertia and vuejs.
So I have a resource controller and the route for it is as following
in Vue (manually supplying an invalid ID)
the route for delete and update have a URL parameter section
the route works perfectly when supplied with the proper ID, but when I manually supply a wrong ID (one that doesn't exist in the DB). it would show me a 404 page (which is the expected behaviour), I searched the docs and found the "missing" method and applied it as above, but now instead of redirecting it back I get an error
Long story short, the workaround found by Sinnbeck was to change the order of middleware in Kernel.php, I did that and the problem is solved
here is his reply
he mentions that he's unsure if changing the order could break other functionalities, as inertia docs asks to put the inertia middleware at the very end.
here is a link to the entire thread
Unsure if this is a bug or the docs need to be updated (i.e. inertia middleware doesn't need to be at the very end).