fix: QrCode relation bug and Endroid create() error
This commit is contained in:
@@ -23,6 +23,7 @@ class QrCode extends Model
|
||||
'status',
|
||||
'replacement_for_id',
|
||||
'assigned_to_household_id',
|
||||
'assigned_to_user_id',
|
||||
'assigned_to_store_id',
|
||||
'allocated_at',
|
||||
'activated_at',
|
||||
@@ -54,7 +55,7 @@ class QrCode extends Model
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
{
|
||||
return LogOptions::defaults()
|
||||
->logOnly(['status', 'assigned_to_household_id', 'assigned_to_store_id', 'used_at_drop_off_id'])
|
||||
->logOnly(['status', 'assigned_to_household_id', 'assigned_to_user_id', 'assigned_to_store_id', 'used_at_drop_off_id'])
|
||||
->logOnlyDirty()
|
||||
->dontSubmitEmptyLogs()
|
||||
->useLogName('qr_code');
|
||||
@@ -70,6 +71,11 @@ class QrCode extends Model
|
||||
return $this->belongsTo(Household::class, 'assigned_to_household_id');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'assigned_to_user_id');
|
||||
}
|
||||
|
||||
public function usedAtDropOff(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DropOffPoint::class, 'used_at_drop_off_id');
|
||||
|
||||
Reference in New Issue
Block a user