updated notes with services and updated sample texts on views
This commit is contained in:
@@ -21,5 +21,20 @@ class ClientNote extends Model
|
||||
public function created_by_info(){
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'auth_user_id');
|
||||
}
|
||||
protected $casts = [
|
||||
'services' => 'array',
|
||||
];
|
||||
|
||||
public function getServiceNamesAttribute()
|
||||
{
|
||||
if (empty($this->services) || !is_array($this->services)) {
|
||||
return collect();
|
||||
}
|
||||
return \App\Models\Service::whereIn('id', $this->services)->pluck('name');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(App\Models\User::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user