2016-10-28 00:05:29 +00:00
|
|
|
<?php
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-01-25 00:15:03 +00:00
|
|
|
namespace Pterodactyl\Observers;
|
2016-10-28 00:05:29 +00:00
|
|
|
|
2017-01-25 00:15:03 +00:00
|
|
|
use Pterodactyl\Events;
|
|
|
|
use Pterodactyl\Models\Server;
|
2016-10-28 00:05:29 +00:00
|
|
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
|
|
|
2017-01-25 00:15:03 +00:00
|
|
|
class ServerObserver
|
2016-10-28 00:05:29 +00:00
|
|
|
{
|
|
|
|
use DispatchesJobs;
|
|
|
|
|
|
|
|
/**
|
2017-02-16 18:56:28 +00:00
|
|
|
* Listen to the Server creating event.
|
2016-10-28 00:05:29 +00:00
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function creating(Server $server): void
|
2016-10-28 00:05:29 +00:00
|
|
|
{
|
2017-01-25 00:15:03 +00:00
|
|
|
event(new Events\Server\Creating($server));
|
2016-10-28 00:05:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-02-16 18:56:28 +00:00
|
|
|
* Listen to the Server created event.
|
2016-10-28 00:05:29 +00:00
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function created(Server $server): void
|
2016-10-28 00:05:29 +00:00
|
|
|
{
|
2017-01-25 00:15:03 +00:00
|
|
|
event(new Events\Server\Created($server));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-02-16 18:56:28 +00:00
|
|
|
* Listen to the Server deleting event.
|
2017-01-25 00:15:03 +00:00
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function deleting(Server $server): void
|
2017-01-25 00:15:03 +00:00
|
|
|
{
|
|
|
|
event(new Events\Server\Deleting($server));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Listen to the Server deleted event.
|
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function deleted(Server $server): void
|
2017-01-25 00:15:03 +00:00
|
|
|
{
|
|
|
|
event(new Events\Server\Deleted($server));
|
2016-10-28 00:05:29 +00:00
|
|
|
}
|
2017-02-17 23:19:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Listen to the Server saving event.
|
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function saving(Server $server): void
|
2017-02-17 23:19:53 +00:00
|
|
|
{
|
|
|
|
event(new Events\Server\Saving($server));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Listen to the Server saved event.
|
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function saved(Server $server): void
|
2017-02-17 23:19:53 +00:00
|
|
|
{
|
|
|
|
event(new Events\Server\Saved($server));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-03-05 00:03:49 +00:00
|
|
|
* Listen to the Server updating event.
|
2017-02-17 23:19:53 +00:00
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function updating(Server $server): void
|
2017-02-17 23:19:53 +00:00
|
|
|
{
|
|
|
|
event(new Events\Server\Updating($server));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Listen to the Server saved event.
|
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function updated(Server $server): void
|
2017-02-17 23:19:53 +00:00
|
|
|
{
|
|
|
|
event(new Events\Server\Updated($server));
|
|
|
|
}
|
2016-10-28 00:05:29 +00:00
|
|
|
}
|