Something went wrong. Try again.
Build Reactive Signals for Bluesky's AT Protocol Firehose in Laravel
Something went wrong. Try again.
805 B · 36 lines
PHP
at dev
12345678910111213141516171819202122232425262728293031323334353637<?php
namespace SocialDept\AtpSignals\Events;
use SocialDept\AtpSignals\Contracts\EventContract;
class IdentityEvent implements EventContract{ public function __construct( public string $did, public ?string $handle = null, public int $seq = 0, public ?string $time = null, ) { }
public static function fromArray(array $data): self { return new self( did: $data['did'], handle: $data['handle'] ?? null, seq: $data['seq'] ?? 0, time: $data['time'] ?? null, ); }
public function toArray(): array { return [ 'did' => $this->did, 'handle' => $this->handle, 'seq' => $this->seq, 'time' => $this->time, ]; }}