0
I am trying to send the data of a form by the POST method, however it is not going at all
Just follow my code
// routes.php
Route::any('/', function()
{
echo Request::getMethod(); // Aqui esta sempre retornando GET
return View::make( 'login' );
});
// view/login.blade.php
<form action="{{URL::to('/')}}" method="post">
<input name="login" type="text"/><br/>
<input type="password" name="senha" id=""/><br/>
{{ Form::submit('Enviar') }}
</form>
Regardless of whether the screen was loaded by the link or the Submit click, the return of Request::getMethod() is always being GET, consequently it has no data in the $_POST, because it happens this way?
I don’t think directing Route to
any
is the best alternative. You have some reason not to use aRoute::get
and aRoute::post
?– gmsantos
Because I am trying to make the Login screen, for security reasons, I think I should use the POST
– Lai32290
Lai, I believe it’s something you want to do, right? https://gist.github.com/gmsantosxl/feaedd41b7cdaff6304c
– gmsantos
Exactly! but I’m doing router separately because I tried with Route::any and I couldn’t, for lack of knowledge, I’m afraid of being technical problems, so I decided to do it separately, but even so, Request::getMethod() is always returning me GET, you know why it happens this?
– Lai32290