authorize('viewAny', [BackupFile::class, $backup]); return BackupFileResource::collection($backup->files()->latest()->simplePaginate(config('web.pagination_size'))); } #[Post('/{backupFile}/restore', name: 'backup-files.restore')] public function restore(Request $request, Server $server, Backup $backup, BackupFile $backupFile): RedirectResponse { $this->authorize('update', $backup); app(RestoreBackup::class)->restore($backupFile, $request->input()); return back() ->with('info', 'Backup is being restored...'); } #[Delete('/{backupFile}', name: 'backup-files.destroy')] public function destroy(Server $server, Backup $backup, BackupFile $backupFile): RedirectResponse { $this->authorize('delete', $backupFile); $backupFile->deleteFile(); return back() ->with('success', 'File deleted successfully.'); } }