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(), 'subscribable_id' => $this->subscribable_id, 'subscribable_type' => $this->subscribable_type, 'plan_id' => $this->plan_id, 'name' => $this->name, 'trial_ends_at' => $this->trial_ends_at, 'starts_at' => $this->starts_at, 'ends_at' => $this->ends_at, 'canceled_at' => $this->canceled_at, 'payment_mode' => $this->payment_mode, 'transaction_no' => $this->transaction_no, 'bank' => $this->bank, 'branch' => $this->branch, 'amount' => $this->amount, 'date' => $this->date, 'payment_gateway_name' => $this->payment_gateway_name, ')' => $this->), '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(''), ], ]; } }