From ed75f5cbfb1ea64b70fbd57fbffb7ceda74beb2e Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Thu, 20 Oct 2022 20:21:57 -0400 Subject: [PATCH] Replace simple paginator --- .../Repository/ServerRepositoryInterface.php | 5 ----- .../Controllers/Admin/Nodes/NodeViewController.php | 2 +- app/Repositories/Eloquent/ServerRepository.php | 11 ----------- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/Contracts/Repository/ServerRepositoryInterface.php b/app/Contracts/Repository/ServerRepositoryInterface.php index 0dfcd9cad..cdd7e0ae1 100644 --- a/app/Contracts/Repository/ServerRepositoryInterface.php +++ b/app/Contracts/Repository/ServerRepositoryInterface.php @@ -50,9 +50,4 @@ interface ServerRepositoryInterface extends RepositoryInterface * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function getByUuid(string $uuid): Server; - - /** - * Returns all the servers that exist for a given node in a paginated response. - */ - public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator; } diff --git a/app/Http/Controllers/Admin/Nodes/NodeViewController.php b/app/Http/Controllers/Admin/Nodes/NodeViewController.php index 673890323..dcb74633f 100644 --- a/app/Http/Controllers/Admin/Nodes/NodeViewController.php +++ b/app/Http/Controllers/Admin/Nodes/NodeViewController.php @@ -96,7 +96,7 @@ class NodeViewController extends Controller return $this->view->make('admin.nodes.view.servers', [ 'node' => $node, - 'servers' => $this->serverRepository->loadAllServersForNode($node->id, 25), + 'servers' => $node->servers()->with(['user', 'nest', 'egg'])->paginate(25), ]); } } diff --git a/app/Repositories/Eloquent/ServerRepository.php b/app/Repositories/Eloquent/ServerRepository.php index 964bec250..c5b3435f2 100644 --- a/app/Repositories/Eloquent/ServerRepository.php +++ b/app/Repositories/Eloquent/ServerRepository.php @@ -133,15 +133,4 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt throw new RecordNotFoundException(); } } - - /** - * Returns all the servers that exist for a given node in a paginated response. - */ - public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator - { - return $this->getBuilder() - ->with(['user', 'nest', 'egg']) - ->where('node_id', '=', $node) - ->paginate($limit); - } }