File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/Http/Controllers/Api/Application/Locations Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 55use Illuminate \Http \Response ;
66use Pterodactyl \Models \Location ;
77use Illuminate \Http \JsonResponse ;
8+ use Spatie \QueryBuilder \QueryBuilder ;
89use Pterodactyl \Services \Locations \LocationUpdateService ;
910use Pterodactyl \Services \Locations \LocationCreationService ;
1011use Pterodactyl \Services \Locations \LocationDeletionService ;
@@ -69,7 +70,10 @@ public function __construct(
6970 */
7071 public function index (GetLocationsRequest $ request ): array
7172 {
72- $ locations = $ this ->repository ->setSearchTerm ($ request ->input ('search ' ))->paginated (50 );
73+ $ locations = QueryBuilder::for (Location::query ())
74+ ->allowedFilters (['short ' , 'long ' ])
75+ ->allowedSorts (['id ' ])
76+ ->paginate (100 );
7377
7478 return $ this ->fractal ->collection ($ locations )
7579 ->transformWith ($ this ->getTransformer (LocationTransformer::class))
You can’t perform that action at this time.
0 commit comments