misc_pterodactyl-panel/app/Providers/EventServiceProvider.php
2022-05-28 17:03:58 -04:00

50 lines
1.4 KiB
PHP

<?php
namespace Pterodactyl\Providers;
use Pterodactyl\Models\User;
use Pterodactyl\Models\Server;
use Pterodactyl\Models\Subuser;
use Pterodactyl\Models\EggVariable;
use Pterodactyl\Observers\UserObserver;
use Pterodactyl\Observers\ServerObserver;
use Pterodactyl\Observers\SubuserObserver;
use Pterodactyl\Observers\EggVariableObserver;
use Pterodactyl\Listeners\Auth\AuthenticationListener;
use Pterodactyl\Events\Server\Installed as ServerInstalledEvent;
use Pterodactyl\Notifications\ServerInstalled as ServerInstalledNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
ServerInstalledEvent::class => [ServerInstalledNotification::class],
];
protected $subscribe = [
AuthenticationListener::class,
];
/**
* Boots the service provider and registers model event listeners.
*/
public function boot()
{
parent::boot();
User::observe(UserObserver::class);
Server::observe(ServerObserver::class);
Subuser::observe(SubuserObserver::class);
EggVariable::observe(EggVariableObserver::class);
}
public function shouldDiscoverEvents()
{
return true;
}
}