__('Status 1'), '2' => __('Status 2')]; } public function getSignTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['sign_time']) ? $data['sign_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setSignTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function active() { return $this->belongsTo('Trainactive', 'train_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }