Replace simple paginator

This commit is contained in:
Lance Pioch 2022-10-20 20:21:57 -04:00
parent 679a25a763
commit ed75f5cbfb
3 changed files with 1 additions and 17 deletions

View file

@ -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;
}

View file

@ -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),
]);
}
}

View file

@ -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);
}
}