Level 5
Have you tried hitting 'contact/submit' with GET in your browser? Also, I'd comment out that catch all while deducing problems.
I am breaking out some code from a laravel app to make a simpler app using lumen and I'm running in to an issue with a post route. When posting to it from a form I get this error:
MethodNotAllowedHttpException in Application.php line 1208:
in Application.php line 1208
at Application->handleDispatcherResponse(array('2', array('GET'))) in Application.php line 1163
at Application->Laravel\Lumen\{closure}() in Application.php line 1390
at Application->sendThroughPipeline(array(), object(Closure)) in Application.php line 1164
at Application->dispatch(null) in Application.php line 1104
at Application->run() in index.php line 28
The routes.php file looks like:
// $app->post('contact/submit', 'ContactController@submit');
//simple route to make sure the problem isn't in my controller
$app->post('contact/submit', function () {
return 'Hello World';
});
//catchall
$app->get('{page_slug:.*}', 'CmsController@page');
I uncommented eloquent and dotenv in the app.php, but otherwise it's a pretty basic lumen install and I'm not sure where the problem is... Any help would be awesome.
Please or to participate in this conversation.