Files
jandl-taskmanager-app/be/app/Providers/EventServiceProvider.php
T

69 lines
1.8 KiB
PHP

<?php
namespace App\Providers;
use App\Events\MasterTaskEdited;
use App\Events\SubTaskCreated;
use App\Events\SubTaskDeleted;
use App\Events\SubTaskEdited;
use App\Listeners\SendDeletedSubTaskNotification;
use App\Listeners\SendEditedMasterTaskNotification;
use App\Listeners\SendEditedSubTaskNotification;
use App\Listeners\SendNewSubTaskEmailNotification;
use App\Models\MasterTask;
use App\Models\SubTask;
use App\Observers\MasterTaskObserver;
use App\Observers\SubTaskObserver;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
SubTaskCreated::class => [
SendNewSubTaskEmailNotification::class,
//LogEvent::class,
],
SubTaskDeleted::class => [
SendDeletedSubTaskNotification::class
],
SubTaskEdited::class => [
SendEditedSubTaskNotification::class
],
MasterTaskEdited::class => [
SendEditedMasterTaskNotification::class
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
MasterTask::observe( MasterTaskObserver::class);
SubTask::observe( SubTaskObserver::class);
}
/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
return false;
}
}