Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Providers/EventServiceProvider.php
14039 views
1
<?php
2
3
namespace Pterodactyl\Providers;
4
5
use Pterodactyl\Models\User;
6
use Pterodactyl\Models\Server;
7
use Pterodactyl\Models\Subuser;
8
use Pterodactyl\Models\EggVariable;
9
use Pterodactyl\Observers\UserObserver;
10
use Pterodactyl\Observers\ServerObserver;
11
use Pterodactyl\Observers\SubuserObserver;
12
use Pterodactyl\Listeners\TwoFactorListener;
13
use Pterodactyl\Listeners\RevocationListener;
14
use Pterodactyl\Observers\EggVariableObserver;
15
use Pterodactyl\Listeners\AuthenticationListener;
16
use Pterodactyl\Events\Server\Installed as ServerInstalledEvent;
17
use Pterodactyl\Notifications\ServerInstalled as ServerInstalledNotification;
18
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
19
20
class EventServiceProvider extends ServiceProvider
21
{
22
/**
23
* The event to listener mappings for the application.
24
*/
25
protected $listen = [
26
ServerInstalledEvent::class => [ServerInstalledNotification::class],
27
];
28
29
protected $subscribe = [
30
AuthenticationListener::class,
31
RevocationListener::class,
32
TwoFactorListener::class,
33
];
34
35
protected static $shouldDiscoverEvents = false;
36
37
/**
38
* Register any events for your application.
39
*/
40
public function boot(): void
41
{
42
parent::boot();
43
44
User::observe(UserObserver::class);
45
Server::observe(ServerObserver::class);
46
Subuser::observe(SubuserObserver::class);
47
EggVariable::observe(EggVariableObserver::class);
48
}
49
}
50
51