25
modules/Vacentral/Listeners/AcarsUpdateListener.php
Normal file
25
modules/Vacentral/Listeners/AcarsUpdateListener.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Vacentral\Listeners;
|
||||
|
||||
use App\Events\AcarsUpdate;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use VaCentral\Contracts\IVaCentral;
|
||||
|
||||
class AcarsUpdateListener
|
||||
{
|
||||
private $vacentral;
|
||||
|
||||
public function __construct(IVaCentral $vacentral)
|
||||
{
|
||||
$this->vacentral = $vacentral;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AcarsUpdate $event
|
||||
*/
|
||||
public function handle(AcarsUpdate $event)
|
||||
{
|
||||
Log::info('Received acars update event', [$event]);
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,14 @@
|
||||
namespace Modules\Vacentral\Listeners;
|
||||
|
||||
use App\Events\PirepAccepted;
|
||||
use Log;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PirepAcceptedEventListener
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param PirepAccepted $pirep
|
||||
*/
|
||||
public function handle(PirepAccepted $pirep)
|
||||
{
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace Modules\Vacentral\Providers;
|
||||
|
||||
use App\Events\AcarsUpdate;
|
||||
use App\Events\PirepAccepted;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Modules\Vacentral\Listeners\AcarsUpdateListener;
|
||||
use Modules\Vacentral\Listeners\PirepAcceptedEventListener;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*/
|
||||
protected $listen = [
|
||||
AcarsUpdate::class => [AcarsUpdateListener::class],
|
||||
PirepAccepted::class => [PirepAcceptedEventListener::class],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user