*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'title' => $this->title, 'notes' => $this->notes, 'wishlist' => $this->wishlist, 'owner' => UserResource::make($this->owner), 'transactions' => TransactionResource::collection($this->whenLoaded('transactions')), 'holdings' => HoldingResource::collection($this->whenLoaded('holdings')), 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; } }