Hello Guys, how are you? Guys, here’s the thing, I used Slim3 and now I decided to migrate to Slim4, but for 3 days I have a very annoying problem and so far I haven’t been able to solve it. When I try to change a record via form, using the PUT method, slim returns the following error:
405 Method Not Allowed
The application could not run because of the following error:Details
Type: Slim\Exception\HttpMethodNotAllowedException
Code: 405
Message: Method not allowed. Must be one of: GET
File: E:\GIT\WEB\IsaquelSilva\dashboard\vendor\slim\slim\Slim\Middleware\RoutingMiddleware.php
Line: 96
My Code
form.php
< form action=“./bancas/33” id=“formulario” method=“POST”>
<input type="hidden" name="_METHOD" value="PUT">
<button id="btn-confirm" type="submit" class="btn btn-primary">Confirm</button>
</form>
routes.php
$app->group(’/bancas’, function(RouteCollectorProxy $group) {
$group->get(’[/{page:[0-9]+}]’, ‘\App\Controller\ControllerBancas:getAll’)->setName(‘bancas’);
$group->get(’/inserir’, ‘\App\Controller\ControllerBancas:openForm’);
$group->get(’/{id:[0-9]+}-{titulo}’, ‘\App\Controller\ControllerBancas:getById’);
$group->post(’’, ‘\App\Controller\ControllerBancas:createData’);
//$group->put(’/{id}’, ‘\App\Controller\ControllerBancas:updateData’);
$group->delete(’/{id:[0-9]+}’, ‘\App\Controller\ControllerBancas:delete’);
});
I don’t know what else to do :'(. Thank’s