belongsTo(Country::class); } public function language() { return $this->belongsTo(Language::class); } public function user() { return $this->belongsTo(\App\User::class); } public function getCompanyAttribute($value) { return $value ? $value : $this->user->SurFirstName; } public function getActiveDisplayAttribute($value) { return sprintf('%s',$this->active ? 'primary' : 'danger',$this->active ? 'Active' : 'Inactive'); } }