$this->id, 'name' => $this->name, 'cover' => $this->cover ??'', 'rules' => nl2br($this->rules ??''), 'start_at' => $this->start_at->format('Y-m-d H:i'), 'end_at' => $this->end_at->format('Y-m-d H:i'), 'state' => $this->state, 'share_image'=> $this->share_image ?? '', 'share_title'=> $this->share_title ?? '', 'has_gift' => $this->when($this->has_gift !== null, $this->has_gift), ]; } public function with($request) { return ['code' => Response::HTTP_OK, 'message' => '']; } }