updated client payment, file upload and notes
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user