Scores/app/Providers/EventServiceProvider.php
Juan Felipe Zapata Moreno be89d18e74 Init
2025-07-01 10:36:19 -06:00

62 lines
1.5 KiB
PHP

<?php
namespace App\Providers;
use App\Listeners\BrodcastUserLoginNotification;
use App\Listeners\BrodcastUserLogoutNotification;
use App\Models\Role;
use App\Models\User;
use App\Observers\RoleObserver;
use App\Observers\UserObserver;
use Illuminate\Auth\Events\Login;
use Illuminate\Auth\Events\Logout;
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,
],
Login::class => [
BrodcastUserLoginNotification::class,
],
Logout::class => [
BrodcastUserLogoutNotification::class,
],
];
protected $observers = [
User::class => [UserObserver::class],
Role::class => [RoleObserver::class],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
return false;
}
}