NBG's avatar
Level 1

Lumen: Class 'Route' not found in "app/Http/routes.php"

Hi,

i got this error after installing (the latest version of) Lumen on my server. Standard structure, nothing changed.

[code]Fatal error: Class 'Route' not found in /is/htdocs/wphg8034hgh30/www/domain/lumen/app/Http/routes.php on line 66 Whoops, looks like something went wrong.[/code]

Line #66 looks like this: Route::get('/', function () { ...

I've tried \Route::get() too...

Why do i need to chance to make it work? And why doesn't it work "out of the box"?

Many thanks!

0 likes
3 replies
NBG's avatar
Level 1

@martinbean

Yes it's uncommented.

But this is how it looks in the Lumen's routes.php:

$app->get('/', function () use ($app) {return $app->version();});

$app->get() ... not Route::get() ... i just thought i can use the working (!) code from Laravel in Lumen too?! Both the latest versions...

Also this produces an error:

$app->get('/party/{eventid}', function($eventid){echo $eventid;})->where('eventid', '[0-9]+');

"Call to undefined method Laravel\Lumen\Application::where()"

martinbean's avatar

@NBG The router that ships with Lumen isn’t the same as the one that ships with Laravel, which is why you might be getting that error.

The where() functionality isn’t covered in the routing documentation for Lumen, so I’m assuming it’s not available for enforcing parameter patterns.

Please or to participate in this conversation.