Files
Atomcms-edit/app/Providers/EventServiceProvider.php
2026-05-09 17:32:17 +02:00

49 lines
1.1 KiB
PHP
Executable File

<?php
declare(strict_types=1);
namespace App\Providers;
use App\Listeners\LogStaffLogin;
use App\Models\User;
use App\Observers\UserObserver;
use Illuminate\Auth\Events\Login;
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>>
*/
#[\Override]
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
#[\Override]
protected $observers = [
User::class => [UserObserver::class],
];
public function boot(): void
{
Event::listen(Login::class, LogStaffLogin::class);
}
/**
* Determine if events and listeners should be automatically discovered.
*/
#[\Override]
public function shouldDiscoverEvents(): bool
{
return false;
}
}