Ошибка MethodNotAllowedHttpException - PullRequest
0 голосов
/ 06 июня 2018

NotFoundHttpException в Application-> handleDispatcherResponse (array (2, array (GET, POST)) *

$router->group(['prefix' => 'api'], function () use ($router) {
$router->post('contingent', ['as' => 'createContingent','uses' =>  'ContingentController@showById']);
$router->get('contingent', 'ContingentController@showAllContingent');
}

Я получаю доступ к этим POST-маршрутам в угловых 4:

$router->post('contingent', ['as' => 'createContingent','uses' =>  'ContingentController@showById']);

И затемошибка:

MethodNotAllowedHttpException

в Application-> handleDispatcherResponse (массив (2, массив (GET, POST))) в строке RoutesRequest.php 164

есть ошибка вмой просвет просвет или в угловых 4?

1 Ответ

0 голосов
/ 12 июня 2018

Я думаю, вы просто забыли вставить префикс api/ в routes при вызове.Попробуйте это your_domain.com/api/contingent с GET или POST запросом

...