I am writing a RESTful API with a new Laravel 5.3 app.
I have a resource defined in routes/api.php
like so:
Route::resource('/simple-path', 'Api\ControllerName');
There is no middleware added on the route itself, nor is there any added in the constructor of that controller, nor is there any middleware added in any parent controllers/classes.
However, Laravel(?) keeps 302 redirecting to /
for any HTTP verb other than GET
, and I am driving myself crazy trying to figure out why. Even if I comment out all the middleware in app/Http/Kernel.php
it still redirects whenever I run a simple POST call to /simple-path
in curl or PostMan.
Now, don't get me wrong, I want the auth:api
middleware on my api, especially for POST or PUT requests, but I can't figure out what is causing it to redirect when there isn't any middleware running in the first place (so far as I can tell).
I've read all the docs on middleware that I can find. I am wondering if there is something other than middleware that could be causing this? This is a fairly fresh app, so I have not changed much from the basic install.