add missing listener files
This commit is contained in:
3
modules/.gitignore
vendored
3
modules/.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
# Ignore everything so if we update via git, nothing is overwritten
|
||||
*
|
||||
|
||||
# But keep the sample and this file around
|
||||
!.gitignore
|
||||
!Sample/*
|
||||
!/Sample/
|
||||
|
||||
16
modules/Sample/Listeners/TestEventListener.php
Normal file
16
modules/Sample/Listeners/TestEventListener.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Sample\Listeners;
|
||||
|
||||
use App\Events\TestEvent;
|
||||
use Log;
|
||||
|
||||
class TestEventListener
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
||||
*/
|
||||
public function handle(TestEvent $event) {
|
||||
Log::info('Received event', [$event]);
|
||||
}
|
||||
}
|
||||
25
modules/Sample/Providers/EventServiceProvider.php
Normal file
25
modules/Sample/Providers/EventServiceProvider.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Sample\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*/
|
||||
protected $listen = [
|
||||
'App\Events\TestEvent' => [
|
||||
'Modules\Sample\Listeners\TestEventListener',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user