ingeniasoftware/luthier-ci

PUT or PATCH methods are not going as expected

Closed this issue · 2 comments

How could I direct the form to be a PUT or PATCH request?

I made the route to be PATCH like:

Route::patch('foo', 'foo@bar')->name(foo.bar);

but the form keeps going as a POST.

I tried to add a hidden _method input field like Laravel:

<input type="hidden" name="_method" value="PATCH">

but it still goes as a POST.

Could you please help.

Bug confirmed. It's a typo in the code ($_SERVER['RQUEST_METHOD']):

luthier-ci/src/Hook.php

Lines 182 to 189 in 3161b02

if(isset($_SERVER['REQUEST_METHOD']))
{
if(strtolower($_SERVER['REQUEST_METHOD']) == 'post' && isset($_POST['_method']))
{
$_SERVER['RQUEST_METHOD'] = $_POST['_method'];
}
$requestMethod = $_SERVER['REQUEST_METHOD'];

Version 1.0.2 released 👍