Laravel Cloudflare

PHP MIT

Complete Laravel Cloudflare API SDK for managing DNS records, zones, cache, SSL, firewall rules, workers, analytics, and Cloudflare services with a fluent Laravel-first developer experience.

Stars
2
Forks
0
Downloads
N/A
Open Issues
0
Files main

Repository Files

Loading file structure...
src/DTOs/R2Bucket.php
<?php

namespace Vendor\Cloudflare\DTOs;

class R2Bucket
{
    public string $name;

    public string $creation_date;

    public string $location;

    public string $storage_class;

    /**
     * Create a new DTO instance from array data.
     */
    public static function fromArray(array $data): self
    {
        $dto = new self;
        $dto->name = (string) ($data['name'] ?? '');
        $dto->creation_date = (string) ($data['creation_date'] ?? '');
        $dto->location = (string) ($data['location'] ?? '');
        $dto->storage_class = (string) ($data['storage_class'] ?? '');

        return $dto;
    }
}