hasMany($related, 'service_id'); } public function getExtraField($key) { $value = ''; $setting = $this->extraFieldRelation()->where('key', $key)->first(); if ($setting) { $value = $setting->value; } return $value; } public function getName() { $name = $this->attributes['name']; $id = $this->attributes['id']; $html = ''.$name.''; return $html; } public function getStatus() { $status = $this->attributes['status']; $html = "".Lang::get('lang.inactive').''; if ($status == 1) { $html = "".Lang::get('lang.active').''; } return $html; } public function getAction() { $id = $this->attributes['id']; $status = $this->attributes['status']; $html = '".Lang::get('lang.activate').''; if ($status == 1) { $html = "".Lang::get('lang.activate').''; } return $html; } public function isActivate() { $check = true; $settings = $this->extraFieldRelation()->get(); if ($settings->count() == 0) { $check = false; } return $check; } }