Move the model callbacks into Observables; reduce caching since it held balances incorrectly
This commit is contained in:
@@ -34,10 +34,8 @@ class Journal extends BaseModel
|
||||
'morphed_id',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'deleted_at',
|
||||
'updated_at'
|
||||
];
|
||||
@@ -50,20 +48,6 @@ class Journal extends BaseModel
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal Journal $journal
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
protected static function boot()
|
||||
{
|
||||
static::created(function (Journal $journal) {
|
||||
$journal->resetCurrentBalances();
|
||||
});
|
||||
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
|
||||
Reference in New Issue
Block a user