*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'provider' => $this->provider->value, 'full_name' => $this->full_name, 'url' => $this->html_url, 'description' => $this->description, 'primary_language' => $this->primary_language, 'languages' => (object) ($this->languages ?? []), 'topics' => $this->topics ?? [], 'license' => $this->license, 'stars' => $this->stars, 'forks' => $this->forks, 'contributors_count' => $this->contributors_count, 'open_issues_count' => $this->open_issues_count, 'is_archived' => $this->is_archived, // Lets the frontend avoid presenting dead work as live. 'is_dormant' => $this->isDormant(), 'pushed_at' => $this->pushed_at?->toIso8601String(), 'synced_at' => $this->last_synced_at?->toIso8601String(), 'good_first_issues' => PublicIssueResource::collection($this->whenLoaded('goodFirstIssues')), 'issues' => PublicIssueResource::collection($this->whenLoaded('issues')), ]; } }