getRouteKey(); } public function title() { if ($this->title != '') { return $this->title; } if ($this->name != '') { return $this->name; } return 'None'; } public function toArray() { return [ 'id' => $this->getRouteKey(), 'title' => $this->title(), 'address_id' => $this->address_id, 'total' => $this->total, 'payment_mode' => $this->payment_mode, 'payment_status' => $this->payment_status, 'payment_id' => $this->payment_id, 'razorpay_payment_id' => $this->razorpay_payment_id, 'razorpay_order_id' => $this->razorpay_order_id, 'razorpay_signature' => $this->razorpay_signature, 'status' => $this->status, 'reason' => $this->reason, 'comments' => $this->comments, 'user_type' => $this->user_type, 'user_id' => $this->user_id, 'created_at' => !is_null($this->created_at) ? $this->created_at->format('Y-m-d H:i:s') : null, 'updated_at' => !is_null($this->updated_at) ? $this->updated_at->format('Y-m-d H:i:s') : null, 'meta' => [ 'exists' => $this->exists(), 'link' => $this->itemLink(), 'upload_url' => $this->getUploadURL(''), ], ]; } }