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/DTOs/Traffic.php
<?php

namespace Vendor\HetznerRobot\DTOs;

class Traffic
{
    public string $type;

    public string $from;

    public string $to;

    public array $data = [];

    public static function fromArray(array $data): self
    {
        $traffic = new self;
        $traffic->type = (string) ($data['type'] ?? '');
        $traffic->from = (string) ($data['from'] ?? '');
        $traffic->to = (string) ($data['to'] ?? '');
        $traffic->data = (array) ($data['data'] ?? []);

        return $traffic;
    }
}