mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 19:36:02 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
24 lines
564 B
PHP
24 lines
564 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Services\Backups;
|
|
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|
use Pterodactyl\Models\Backup;
|
|
use Pterodactyl\Models\Server;
|
|
|
|
class BackupListService
|
|
{
|
|
/**
|
|
* @return array{backups: LengthAwarePaginator<int, Backup>, backup_count: int}
|
|
*/
|
|
public function handle(Server $server, int $perPage): array
|
|
{
|
|
return [
|
|
'backups' => $server->backups()->paginate($perPage),
|
|
'backup_count' => $server->backups()->nonFailed()->count(),
|
|
];
|
|
}
|
|
}
|