$this->whenLoaded('user', function () { return $this->user?->nick_name ?? ''; }, ''), 'avatar' => $this->whenLoaded('user', function () { return $this->user?->avatar ?? ''; }, ''), 'join_times' => $this->join_times, 'right_times' => $this->right_times, 'mark' => $this->mark, 'has_gift' => $this->has_gift, 'activity' => ActivityResource::make($this->whenLoaded('activity')) ]; } public function with($request) { return ['code' => Response::HTTP_OK, 'message' => '']; } }