repository = $repository; } /** * Handles updating the state of a backup. * * @param \Pterodactyl\Http\Requests\Api\Remote\ReportBackupCompleteRequest $request * @param string $backup * @return \Illuminate\Http\JsonResponse */ public function __invoke(ReportBackupCompleteRequest $request, string $backup) { $this->repository->updateWhere([['uuid', '=', $backup]], [ 'is_successful' => $request->input('successful') ? true : false, 'sha256_hash' => $request->input('checksum'), 'bytes' => $request->input('size'), 'completed_at' => CarbonImmutable::now(), ]); return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT); } }