>, failed: array} $result */ public function __construct(Post $post, private readonly array $result) { parent::__construct($post); } /** * @return array */ public function toArray(Request $request): array { return [ 'post' => (new PostResource($this->resource))->resolve(), 'attached_count' => count($this->result['attached']), 'failed_urls' => $this->result['failed'], ]; } }