From 7d8eba15956b6a73ac53c834a4cff9ccb8514250 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sat, 22 Oct 2022 20:13:42 -0400 Subject: [PATCH] Replace server variable repository --- .../ServerVariableRepositoryInterface.php | 7 ------- .../Api/Client/Servers/StartupController.php | 10 ++++------ app/Providers/RepositoryServiceProvider.php | 3 --- .../Eloquent/ServerVariableRepository.php | 17 ----------------- app/Services/Servers/ServerCreationService.php | 5 ++--- 5 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 app/Contracts/Repository/ServerVariableRepositoryInterface.php delete mode 100644 app/Repositories/Eloquent/ServerVariableRepository.php diff --git a/app/Contracts/Repository/ServerVariableRepositoryInterface.php b/app/Contracts/Repository/ServerVariableRepositoryInterface.php deleted file mode 100644 index dc3e241a9..000000000 --- a/app/Contracts/Repository/ServerVariableRepositoryInterface.php +++ /dev/null @@ -1,7 +0,0 @@ -validate($request, ['value' => $variable->rules]); - $this->repository->updateOrCreate([ + ServerVariable::query()->updateOrCreate([ 'server_id' => $server->id, 'variable_id' => $variable->id, ], [ diff --git a/app/Providers/RepositoryServiceProvider.php b/app/Providers/RepositoryServiceProvider.php index 8a0434f52..b4ae08339 100644 --- a/app/Providers/RepositoryServiceProvider.php +++ b/app/Providers/RepositoryServiceProvider.php @@ -26,7 +26,6 @@ use Pterodactyl\Contracts\Repository\UserRepositoryInterface; use Pterodactyl\Repositories\Eloquent\DatabaseHostRepository; use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; -use Pterodactyl\Repositories\Eloquent\ServerVariableRepository; use Pterodactyl\Contracts\Repository\SessionRepositoryInterface; use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; @@ -36,7 +35,6 @@ use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; use Pterodactyl\Contracts\Repository\EggVariableRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; -use Pterodactyl\Contracts\Repository\ServerVariableRepositoryInterface; class RepositoryServiceProvider extends ServiceProvider { @@ -57,7 +55,6 @@ class RepositoryServiceProvider extends ServiceProvider $this->app->bind(NodeRepositoryInterface::class, NodeRepository::class); $this->app->bind(ScheduleRepositoryInterface::class, ScheduleRepository::class); $this->app->bind(ServerRepositoryInterface::class, ServerRepository::class); - $this->app->bind(ServerVariableRepositoryInterface::class, ServerVariableRepository::class); $this->app->bind(SessionRepositoryInterface::class, SessionRepository::class); $this->app->bind(SettingsRepositoryInterface::class, SettingsRepository::class); $this->app->bind(SubuserRepositoryInterface::class, SubuserRepository::class); diff --git a/app/Repositories/Eloquent/ServerVariableRepository.php b/app/Repositories/Eloquent/ServerVariableRepository.php deleted file mode 100644 index 26ded2cf6..000000000 --- a/app/Repositories/Eloquent/ServerVariableRepository.php +++ /dev/null @@ -1,17 +0,0 @@ -toArray(); if (!empty($records)) { - $this->serverVariableRepository->insert($records); + ServerVariable::query()->insert($records); } }