Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Arrayable interface to Atproto Sync response classes

+43 -3
+16 -1
src/Data/Responses/Atproto/Sync/GetRepoStatusResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync; 4 4 5 - class GetRepoStatusResponse 5 + use Illuminate\Contracts\Support\Arrayable; 6 + 7 + /** 8 + * @implements Arrayable<string, mixed> 9 + */ 10 + class GetRepoStatusResponse implements Arrayable 6 11 { 7 12 public function __construct( 8 13 public readonly string $did, ··· 19 24 status: $data['status'] ?? null, 20 25 rev: $data['rev'] ?? null, 21 26 ); 27 + } 28 + 29 + public function toArray(): array 30 + { 31 + return [ 32 + 'did' => $this->did, 33 + 'active' => $this->active, 34 + 'status' => $this->status, 35 + 'rev' => $this->rev, 36 + ]; 22 37 } 23 38 }
+14 -1
src/Data/Responses/Atproto/Sync/ListBlobsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync; 4 4 5 - class ListBlobsResponse 5 + use Illuminate\Contracts\Support\Arrayable; 6 + 7 + /** 8 + * @implements Arrayable<string, mixed> 9 + */ 10 + class ListBlobsResponse implements Arrayable 6 11 { 7 12 /** 8 13 * @param array<string> $cids ··· 18 23 cids: $data['cids'] ?? [], 19 24 cursor: $data['cursor'] ?? null, 20 25 ); 26 + } 27 + 28 + public function toArray(): array 29 + { 30 + return [ 31 + 'cids' => $this->cids, 32 + 'cursor' => $this->cursor, 33 + ]; 21 34 } 22 35 }
+13 -1
src/Data/Responses/Atproto/Sync/ListReposResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync; 4 4 5 + use Illuminate\Contracts\Support\Arrayable; 5 6 use Illuminate\Support\Collection; 6 7 7 - class ListReposResponse 8 + /** 9 + * @implements Arrayable<string, mixed> 10 + */ 11 + class ListReposResponse implements Arrayable 8 12 { 9 13 /** 10 14 * @param Collection<int, array{did: string, head: string, rev: string, active?: bool, status?: string}> $repos ··· 20 24 repos: collect($data['repos'] ?? []), 21 25 cursor: $data['cursor'] ?? null, 22 26 ); 27 + } 28 + 29 + public function toArray(): array 30 + { 31 + return [ 32 + 'repos' => $this->repos->all(), 33 + 'cursor' => $this->cursor, 34 + ]; 23 35 } 24 36 }