Method error The GET method is not supported for this route. Supported methods: POST

Asked

Viewed 651 times

0

I already looked at the gringo stackoverflow and nothing. I tried to add @csrf and all the other solutions presented as clearing the route for example. What happens is that the error persists.

Web Route:

Route::get('/', function () {
  return view('welcome');
});

Route::post('authentication', 'Login@authentication');

Form:

      <form action="authentication" method="post">                
        @csrf   

        <label for="name">Nome:</label>
        <input type="text" name="name" id="name">
        <label for="password">Senha:</label>
        <input type="password" name="password" id="password">
        <input type="submit" value="enviar">
    </form>

Controller

class Login extends Controller
{
    public function authentication()
    {
       return 'true';
    }
}
  • What’s the mistake????

  • title. It is not accepting the post in the form

1 answer

1

I recommend you make two adjustments, the first in your route file, change the route of Authentication to stay as follows:

Route::post('/authentication', 'Login@authentication')->name('autenticar');

The second change would be in your form. Change the FORM tag to look like this:

<form method="POST" action="{{ route('autenticar')}}">
  • I made the auterações but it continues giving the same error message

Browser other questions tagged

You are not signed in. Login or sign up in order to post.