getRouteKey(); } public function title() { if ($this->title != '') { return $this->title; } if ($this->name != '') { return $this->name; } return 'None'; } public function toArray($request) { return [ 'id' => $this->getRouteKey(), 'title' => $this->title(), 'slug' => $this->slug, 'restaurant_id' => $this->restaurant_id, 'rule_slug' => $this->rule_slug, 'category_id' => $this->category_id, 'menu_id' => $this->menu_id, 'offer_type' => $this->offer_type, 'offer_value' => $this->offer_value, 'limit_amount' => $this->limit_amount, 'expires_in' => $this->expires_in, 'past_days' => $this->past_days, 'send_mail' => $this->send_mail, 'send_text' => $this->send_text, 'offer_text' => $this->offer_text, 'start_date' => $this->start_date, 'end_date' => $this->end_date, 'image' => $this->image, 'status' => $this->status, 'user_id' => $this->user_id, 'user_type' => $this->user_type, 'converted' => $this->converted, 'PRIMARY' => $this->PRIMARY, '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(''), 'workflow' => $this->workflows(), 'actions' => $this->actions(), ], ]; } /** * Get additional data that should be returned with the resource array. * * @param \Illuminate\Http\Request $request * @return array */ public function with($request) { return [ 'meta' => [ 'exists' => $this->exists(), 'link' => $this->itemLink(), 'upload_url' => $this->getUploadURL(''), 'workflow' => $this->workflows(), 'actions' => $this->actions(), ], ]; } /** * Get the workflows for the resource. * * @return array */ private function workflows() { $arr = []; return $arr; } /** * Get the actions for the resource. * * @return array */ private function actions() { $arr = []; return $arr; } }