buildModificationService = $buildModificationService; $this->detailsModificationService = $detailsModificationService; } /** * Update the details for a specific server. * * @param \Pterodactyl\Http\Requests\Api\Application\Servers\UpdateServerDetailsRequest $request * @param \Pterodactyl\Models\Server $server * @return array * * @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function details(UpdateServerDetailsRequest $request, Server $server): array { $server = $this->detailsModificationService->returnUpdatedModel()->handle($server, $request->validated()); return $this->fractal->item($server) ->transformWith($this->getTransformer(ServerTransformer::class)) ->toArray(); } /** * Update the build details for a specific server. * * @param \Pterodactyl\Http\Requests\Api\Application\Servers\UpdateServerBuildConfigurationRequest $request * @param \Pterodactyl\Models\Server $server * @return array * * @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function build(UpdateServerBuildConfigurationRequest $request, Server $server): array { $server = $this->buildModificationService->handle($server, $request->validated()); return $this->fractal->item($server) ->transformWith($this->getTransformer(ServerTransformer::class)) ->toArray(); } }