Laravel Hetzner Robot

PHP MIT

Laravel SDK for the Hetzner Robot API with fluent resources, type-safe responses, failover IP management, dedicated server automation, and seamless Laravel integration.

Stars
20
Forks
0
Downloads
2,250
Open Issues
0
Files main

Repository Files

Loading file structure...
src/Managers/WolManager.php
<?php

namespace Vendor\HetznerRobot\Managers;

use Vendor\HetznerRobot\DTOs\Wol;

class WolManager extends AbstractManager
{
    public function find(int $serverNumber): mixed
    {
        $response = $this->getRequest("wol/{$serverNumber}");

        return $this->hydrate($response, function (array $data) {
            return Wol::fromArray($data['wol'] ?? []);
        });
    }

    public function send(int $serverNumber): mixed
    {
        $response = $this->postRequest("wol/{$serverNumber}");

        return $this->hydrate($response, function (array $data) {
            return Wol::fromArray($data['wol'] ?? []);
        });
    }
}