mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-16 21:33:44 +02:00
Update all remaining code pathways to use new search tooling
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace Pterodactyl\Http\Controllers\Admin\Servers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Spatie\QueryBuilder\QueryBuilder;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Repositories\Eloquent\ServerRepository;
|
||||
@@ -42,10 +44,11 @@ class ServerController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
return $this->view->make('admin.servers.index', [
|
||||
'servers' => $this->repository->setSearchTerm($request->input('query'))->getAllServers(
|
||||
config()->get('pterodactyl.paginate.admin.servers')
|
||||
),
|
||||
]);
|
||||
$servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation'))
|
||||
->allowedIncludes(['uuid', 'name', 'image'])
|
||||
->allowedSorts(['id', 'uuid'])
|
||||
->paginate(config()->get('pterodactyl.paginate.admin.servers'));
|
||||
|
||||
return $this->view->make('admin.servers.index', ['servers' => $servers]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user