*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'title' => $this->title, 'is_done' => $this->is_done, 'due_at' => optional($this->due_at)?->toISOString(), 'created_at' => $this->created_at->toISOString(), 'updated_at' => $this->updated_at->toISOString(), 'tags' => TagResource::collection( $this->whenLoaded('tags') ), ]; } }