2019-05-20 07:37:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2023-03-02 14:32:53 +01:00
|
|
|
use App\Events\GroupDeleted;
|
2023-03-10 22:59:46 +01:00
|
|
|
use App\Events\GroupDeleting;
|
2024-10-18 14:28:45 +02:00
|
|
|
use App\Events\storeIconsInDatabaseSettingChanged;
|
2022-10-12 11:10:51 +02:00
|
|
|
use App\Events\ScanForNewReleaseCalled;
|
2022-11-22 15:15:52 +01:00
|
|
|
use App\Events\TwoFAccountDeleted;
|
2024-04-26 08:01:20 +02:00
|
|
|
use App\Events\VisitedByProxyUser;
|
2024-04-22 14:59:20 +02:00
|
|
|
use App\Listeners\Authentication\FailedLoginListener;
|
|
|
|
use App\Listeners\Authentication\LoginListener;
|
|
|
|
use App\Listeners\Authentication\LogoutListener;
|
2024-04-26 08:01:20 +02:00
|
|
|
use App\Listeners\Authentication\VisitedByProxyUserListener;
|
2022-09-21 21:50:41 +02:00
|
|
|
use App\Listeners\CleanIconStorage;
|
|
|
|
use App\Listeners\DissociateTwofaccountFromGroup;
|
2024-06-28 16:13:45 +02:00
|
|
|
use App\Listeners\LogNotificationListener;
|
2024-10-18 14:28:45 +02:00
|
|
|
use App\Listeners\ToggleIconReplicationToDatabase;
|
2023-12-20 16:55:58 +01:00
|
|
|
use App\Listeners\RegisterOpenId;
|
2022-11-22 15:15:52 +01:00
|
|
|
use App\Listeners\ReleaseRadar;
|
2023-03-02 14:32:53 +01:00
|
|
|
use App\Listeners\ResetUsersPreference;
|
2024-01-29 08:46:09 +01:00
|
|
|
use App\Models\User;
|
|
|
|
use App\Observers\UserObserver;
|
2024-04-22 14:59:20 +02:00
|
|
|
use Illuminate\Auth\Events\Failed;
|
|
|
|
use Illuminate\Auth\Events\Login;
|
|
|
|
use Illuminate\Auth\Events\Logout;
|
2019-05-20 07:37:41 +02:00
|
|
|
use Illuminate\Auth\Events\Registered;
|
|
|
|
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
|
|
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
2024-02-26 15:04:47 +01:00
|
|
|
use Illuminate\Notifications\Events\NotificationSent;
|
2023-11-20 23:25:36 +01:00
|
|
|
use SocialiteProviders\Manager\SocialiteWasCalled;
|
2019-05-20 07:37:41 +02:00
|
|
|
|
|
|
|
class EventServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The event listener mappings for the application.
|
|
|
|
*
|
2023-03-26 23:04:06 +02:00
|
|
|
* @var array<string, array<int, string>>
|
2019-05-20 07:37:41 +02:00
|
|
|
*/
|
|
|
|
protected $listen = [
|
|
|
|
Registered::class => [
|
|
|
|
SendEmailVerificationNotification::class,
|
|
|
|
],
|
2022-09-21 21:50:41 +02:00
|
|
|
TwoFAccountDeleted::class => [
|
|
|
|
CleanIconStorage::class,
|
2021-11-30 17:34:35 +01:00
|
|
|
],
|
2022-09-21 21:50:41 +02:00
|
|
|
GroupDeleting::class => [
|
|
|
|
DissociateTwofaccountFromGroup::class,
|
|
|
|
],
|
2023-03-02 14:32:53 +01:00
|
|
|
GroupDeleted::class => [
|
|
|
|
ResetUsersPreference::class,
|
|
|
|
],
|
2022-10-12 11:10:51 +02:00
|
|
|
ScanForNewReleaseCalled::class => [
|
2022-09-21 21:50:41 +02:00
|
|
|
ReleaseRadar::class,
|
2021-11-30 17:34:35 +01:00
|
|
|
],
|
2023-11-20 23:25:36 +01:00
|
|
|
SocialiteWasCalled::class => [
|
|
|
|
RegisterOpenId::class,
|
|
|
|
],
|
2024-02-26 15:04:47 +01:00
|
|
|
NotificationSent::class => [
|
2024-06-28 16:13:45 +02:00
|
|
|
LogNotificationListener::class,
|
2024-02-26 15:04:47 +01:00
|
|
|
],
|
2024-04-22 14:59:20 +02:00
|
|
|
Login::class => [
|
|
|
|
LoginListener::class,
|
|
|
|
],
|
|
|
|
Failed::class => [
|
|
|
|
FailedLoginListener::class,
|
|
|
|
],
|
|
|
|
Logout::class => [
|
|
|
|
LogoutListener::class,
|
|
|
|
],
|
2024-04-24 14:06:15 +02:00
|
|
|
VisitedByProxyUser::class => [
|
|
|
|
VisitedByProxyUserListener::class,
|
|
|
|
],
|
2024-10-18 14:28:45 +02:00
|
|
|
storeIconsInDatabaseSettingChanged::class => [
|
|
|
|
ToggleIconReplicationToDatabase::class,
|
|
|
|
],
|
2019-05-20 07:37:41 +02:00
|
|
|
];
|
2024-03-29 09:42:54 +01:00
|
|
|
|
2024-01-29 08:46:09 +01:00
|
|
|
/**
|
2024-03-29 09:42:54 +01:00
|
|
|
* The model observers for your application.
|
|
|
|
*
|
|
|
|
* @var array<string, string|object|array<int, string|object>>
|
|
|
|
*/
|
2024-10-18 14:28:45 +02:00
|
|
|
// TODO: bind the observer using the ObservedBy attribute (https://laravel.com/docs/11.x/eloquent#defining-observers)
|
2024-01-29 08:46:09 +01:00
|
|
|
protected $observers = [
|
|
|
|
User::class => [UserObserver::class],
|
|
|
|
];
|
2019-05-20 07:37:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any events for your application.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
2023-08-01 11:26:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine if events and listeners should be automatically discovered.
|
|
|
|
*/
|
|
|
|
public function shouldDiscoverEvents() : bool
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2019-05-20 07:37:41 +02:00
|
|
|
}
|