mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-11 02:43:45 +02:00
Add base implementation of extendable events classes
Modified server deletion to use internal event handlers from the Eloquent models themselves. Also added a few preliminary event handlers in the `Pterodactyl\Events\<USer|Server> namespace that users can hook into in EventServiceProvider to perform their own actions as they please (such as push notifications and such).
This commit is contained in:
@@ -29,7 +29,6 @@ use Log;
|
||||
use Crypt;
|
||||
use Validator;
|
||||
use Pterodactyl\Models;
|
||||
use Pterodactyl\Events\ServerDeleted;
|
||||
use Pterodactyl\Services\UuidService;
|
||||
use Pterodactyl\Services\DeploymentService;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
@@ -797,9 +796,7 @@ class ServerRepository
|
||||
}
|
||||
|
||||
$server->delete();
|
||||
DB::commit();
|
||||
|
||||
event(new ServerDeleted($server->id));
|
||||
return DB::commit();
|
||||
} catch (\Exception $ex) {
|
||||
DB::rollBack();
|
||||
throw $ex;
|
||||
|
||||
Reference in New Issue
Block a user