Refactor script
This commit is contained in:
@ -19,6 +19,8 @@ class Customer extends Model
|
||||
'longitude',
|
||||
'city',
|
||||
'pic_sales_id',
|
||||
'category', // Added for consistency with Merchant
|
||||
'agent_id', // Added for ownership
|
||||
];
|
||||
|
||||
/**
|
||||
@ -28,4 +30,12 @@ class Customer extends Model
|
||||
{
|
||||
return $this->belongsTo(User::class, 'pic_sales_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the agent associated with the customer.
|
||||
*/
|
||||
public function agent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Agent::class, 'agent_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user