Laravel Routes 5.6

Asked

Viewed 89 times

0

Gentlemen I’m having trouble setting the wheels and returns me the following error:

protected function methodNotAllowed(array $others)
{
    throw new MethodNotAllowedHttpException($others);
}

I’m doing them this way:

route/web.php

$this->post('cadastrar-sub-categoria', 'CategoriaController@cadastrarSubCategoria')->name('cadastrarSubCategoria');

php controller.

public function cadastrarSubCategoria(){
    return 'OK';
}

Where can I be wrong? I am starting my studies in Aravel 5.6!

Thank you.

  • 1

    If you are accessing this via browser, it is GET. You created a route POST

  • 1

    Valew @Diegosouza, that was it! Thank you

No answers

Browser other questions tagged

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