updated client payment, file upload and notes

This commit is contained in:
Kwesi Banson Jnr
2026-08-08 20:47:45 +00:00
parent daf7d9b9dc
commit 6cce100e62
17 changed files with 508 additions and 94 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Service;
class ClientPayment extends Model
{
@@ -15,4 +16,21 @@ class ClientPayment extends Model
public function created_by_info(){
return $this->hasOne('App\Models\Account', 'id', 'auth_user_id');
}
// public function services(){
// return $this->hasMany('App\Models\Service', 'id', 'client_id');
// }
protected $casts = [
'services' => 'array',
];
public function getServiceNamesAttribute()
{
if (empty($this->services) || !is_array($this->services)) {
return collect();
}
return Service::whereIn('id', $this->services)->pluck('name');
}
}