I don't see why it should not work.
To answer your last question, here is some documentation.
https://laravel.com/docs/9.x/controllers#resource-controllers
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm creating some microsservices with Lumen, which will have each base url managed by a server, and I need to create a POST route at application's root.
This way, the server (Apache, NGINX, etc) will point api.domain.com/users, api.domain.com/courses, api.domain.com/teachers etc to each application, so creating and listing entries will be executed at root. But, when I try to POST something to root route, it's returning a GET request instead a POST.
My web.php routing file looks this way:
$router->get("/", "ApiModule@list");
$router->get("/{id}", "ApiModule@read");
$router->post("/", "ApiModule@create");
$router->delete("/{id}", "ApiModule@delete");
$router->put("/{id}", "ApiModule@update");
Testing GET requests with Postman and Insomnia to /, I receive the expected result: a JSON formatted list of registered courses. But, when I try to create a new course sending a POST request to /, it's not working as expected, since is returning a JSON formatted list of registered courses (like the GET route) and doesn't create a new course.
Testing with $route->addRoute(["GET", "POST", "PUT", "DELETE"], "/", "ApiModule@test") to create a multi-method route that points to a single function in my controller, and "dding" $request->method() in that function, it's always returning GET, even with POST, PUT and DELETE requests. This doesn't happens with other routes than root.
Please or to participate in this conversation.