ingeniasoftware / luthier-ci

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework
https://luthier.ingenia.me/ci/en/
MIT License
150 stars 38 forks source link

PUT or PATCH methods are not going as expected #32

Closed Ihabafia closed 5 years ago

Ihabafia commented 5 years ago

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.

andersonsalas commented 5 years ago

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

https://github.com/ingeniasoftware/luthier-ci/blob/3161b025de019613e525fd1574c9e53dfa6fa11c/src/Hook.php#L182-L189

andersonsalas commented 5 years ago

Version 1.0.2 released :+1: