Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NotFoundHttpException with Lumen

Tags:

laravel

lumen

I've just installed Lumen on Windows and unfortunately I'm getting the following error:

NotFoundHttpException in Application.php line 1093:

in Application.php line 1093
at Application->handleDispatcherResponse(array('0')) in Application.php line 1063
at Application->dispatch(null) in Application.php line 1006
at Application->run() in index.php line 28

What may be the problem here?

like image 246
Timo Güntner Avatar asked Apr 19 '15 11:04

Timo Güntner


2 Answers

The problem was solved by changing the

$app->run();

in /public/index.php to

$request = Illuminate\Http\Request::capture();
$app->run($request);
like image 94
Timo Güntner Avatar answered Nov 15 '22 10:11

Timo Güntner


On your index.php file. Change this line

$app->run();

Into:

$app->run($app->request);

Update

Using make method is faster than accessing class alias via array access.

This one also works:

$app->run(
    $app->make('request')
);
like image 64
krisanalfa Avatar answered Nov 15 '22 08:11

krisanalfa