__('Live'), 'Scheduled' => __('Scheduled'), 'Delisted' => __('Delisted')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPublishedtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['publishedtime']) ? $data['publishedtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setPublishedtimeAttr($value) { return $value === '' ? null : $value; // return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function topic() { return $this->belongsTo('Topic', 'topic_ids', 'id', [], 'LEFT')->setEagerlyType(0); } public function author() { return $this->belongsTo('Author', 'author', 'id', [], 'LEFT')->setEagerlyType(0); } }