From 384612360e831fe2f418435fa66a9895cd280401 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sat, 16 Mar 2024 19:32:24 -0400 Subject: [PATCH] Remove server variable repository --- .../ServerVariableRepositoryInterface.php | 7 ------- .../Api/Client/Servers/StartupController.php | 5 ++--- app/Providers/RepositoryServiceProvider.php | 3 --- .../Eloquent/ServerVariableRepository.php | 17 ----------------- app/Services/Servers/ServerCreationService.php | 5 ++--- 5 files changed, 4 insertions(+), 33 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 663e656ec..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 5677f51ee..0613da335 100644 --- a/app/Providers/RepositoryServiceProvider.php +++ b/app/Providers/RepositoryServiceProvider.php @@ -16,7 +16,6 @@ use App\Repositories\Eloquent\EggVariableRepository; use App\Contracts\Repository\NodeRepositoryInterface; use App\Repositories\Eloquent\DatabaseHostRepository; use App\Contracts\Repository\ApiKeyRepositoryInterface; -use App\Repositories\Eloquent\ServerVariableRepository; use App\Contracts\Repository\SessionRepositoryInterface; use App\Contracts\Repository\SubuserRepositoryInterface; use App\Contracts\Repository\DatabaseRepositoryInterface; @@ -24,7 +23,6 @@ use App\Contracts\Repository\SettingsRepositoryInterface; use App\Contracts\Repository\AllocationRepositoryInterface; use App\Contracts\Repository\EggVariableRepositoryInterface; use App\Contracts\Repository\DatabaseHostRepositoryInterface; -use App\Contracts\Repository\ServerVariableRepositoryInterface; class RepositoryServiceProvider extends ServiceProvider { @@ -41,7 +39,6 @@ class RepositoryServiceProvider extends ServiceProvider $this->app->bind(EggRepositoryInterface::class, EggRepository::class); $this->app->bind(EggVariableRepositoryInterface::class, EggVariableRepository::class); $this->app->bind(NodeRepositoryInterface::class, NodeRepository::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 e679390cd..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); } }