*/ class SearchActorsResponse implements Arrayable { /** * @param Collection $actors */ public function __construct( public readonly Collection $actors, public readonly ?string $cursor = null, ) {} public static function fromArray(array $data): self { return new self( actors: collect($data['actors'] ?? [])->map( fn (array $actor) => ProfileView::fromArray($actor) ), cursor: $data['cursor'] ?? null, ); } public function toArray(): array { return [ 'actors' => $this->actors->map(fn (ProfileView $a) => $a->toArray())->all(), 'cursor' => $this->cursor, ]; } }