petehouston's avatar

Event not working in Lumen

I've just tested the Event according to the docs Lumen - Event , but it doesn't seem to work.

class 'Event' not found

Anyone got the idea?

0 likes
3 replies
bestmomo's avatar

Did you set the facades in bootstrap/app.php ?

$app->withFacades();
paul.schneider@yepyep.co.uk's avatar

I believe this is down to :

$app->withFacades();

in bootstrap/app.php not including the event facade as a class alias. Adding:

class_alias('Illuminate\Support\Facades\Event', 'Event');

to Laravel\Lumen\Application.php fixes the issue. This is however a Lumen core file so not recommended as a fix.

Please or to participate in this conversation.