public function toArray($request): array 	{ 		return [ 			'id' => $this->id, 			'title' => $this->title, 			'period_from' => $this->period_from ? formatLocalTimestamp($this->period_to, 'Y-m-d H:i:s') : null, 			'period_to' => $this->period_to ? formatLocalTimestamp($this->period_to, 'Y-m-d H:i:s') : null, 			'amount' => $this->amount, 			'active' => $this->active, 			'code' => $this->when($this->type == Discount::COUPON_CODE_DISCOUNT, $this->code), 			'add_up_with_other_discounts' => $this->add_up_with_other_discounts, 			'is_percentage' => $this->is_percentage, 			'created_at' => formatTimestamp($this->created_at), 			'updated_at' => formatTimestamp($this->updated_at), 		]; 	}