updated notes with services and updated sample texts on views

This commit is contained in:
Kwesi Banson Jnr
2026-08-08 21:20:40 +00:00
parent fc89b9c068
commit cab4591777
7 changed files with 102 additions and 24 deletions

View File

@@ -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);
}
}