$this->id, 'gift_name'=>$this->whenLoaded('gift', function () { return $this->gift->name; }, ''), 'gift_logo'=> $this->whenLoaded('gift', function () { return $this->gift->logo; }, ''), 'gift_rank'=> $this->whenLoaded('gift', function () { return $this->gift->rank; }, ''), 'gift_explain'=> $this->whenLoaded('gift', function () { return $this->gift->explain; }, ''), 'activity_name' => $this->whenLoaded('activity', function () { return $this->activity->name; }, ''), 'consignee' => $this->consignee ?? '', 'address' => $this->address ?? '', 'phone' => $this->phone ?? '', 'shipping_company' => $this->shipping_company ?? '', 'shipping_number' => $this->shipping_number ?? '', 'state' => $this->state, ]; } public function with($request) { return ['code' => Response::HTTP_OK, 'message' => '']; } }