Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

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

Wrap ATProto Repo and Sync response arrays in Laravel Collections

+10 -6
+5 -3
src/Data/Responses/Atproto/Repo/ListRecordsResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo; 4 4 5 + use Illuminate\Support\Collection; 6 + 5 7 class ListRecordsResponse 6 8 { 7 9 /** 8 - * @param array<array{uri: string, cid: string, value: mixed}> $records 10 + * @param Collection<int, array{uri: string, cid: string, value: mixed}> $records 9 11 */ 10 12 public function __construct( 11 - public readonly array $records, 13 + public readonly Collection $records, 12 14 public readonly ?string $cursor = null, 13 15 ) {} 14 16 15 17 public static function fromArray(array $data): self 16 18 { 17 19 return new self( 18 - records: $data['records'] ?? [], 20 + records: collect($data['records'] ?? []), 19 21 cursor: $data['cursor'] ?? null, 20 22 ); 21 23 }
+5 -3
src/Data/Responses/Atproto/Sync/ListReposResponse.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync; 4 4 5 + use Illuminate\Support\Collection; 6 + 5 7 class ListReposResponse 6 8 { 7 9 /** 8 - * @param array<array{did: string, head: string, rev: string, active?: bool, status?: string}> $repos 10 + * @param Collection<int, array{did: string, head: string, rev: string, active?: bool, status?: string}> $repos 9 11 */ 10 12 public function __construct( 11 - public readonly array $repos, 13 + public readonly Collection $repos, 12 14 public readonly ?string $cursor = null, 13 15 ) {} 14 16 15 17 public static function fromArray(array $data): self 16 18 { 17 19 return new self( 18 - repos: $data['repos'] ?? [], 20 + repos: collect($data['repos'] ?? []), 19 21 cursor: $data['cursor'] ?? null, 20 22 ); 21 23 }