changes
This commit is contained in:
@@ -18,6 +18,7 @@ class Activity extends Model
|
||||
'amount',
|
||||
'note',
|
||||
'action_id',
|
||||
'user_id',
|
||||
'decision_id'
|
||||
];
|
||||
|
||||
@@ -25,9 +26,20 @@ class Activity extends Model
|
||||
'action_id',
|
||||
'decision_id',
|
||||
'client_case_id',
|
||||
'user_id',
|
||||
'contract_id'
|
||||
];
|
||||
|
||||
protected static function booted(){
|
||||
static::creating(function (Activity $activity) {
|
||||
if(!isset($activity->user_id)){
|
||||
$activity->user_id = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function action(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Action::class);
|
||||
|
||||
Reference in New Issue
Block a user