2018-03-19 09:37:35 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Observers;
|
|
|
|
|
|
|
|
use App\Models\Journal;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class JournalObserver
|
|
|
|
*/
|
|
|
|
class JournalObserver
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param Journal $journal
|
2018-08-27 00:40:04 +08:00
|
|
|
*
|
2018-03-19 09:37:35 +08:00
|
|
|
* @throws \UnexpectedValueException
|
|
|
|
* @throws \InvalidArgumentException
|
|
|
|
*/
|
|
|
|
public function creating(Journal $journal): void
|
|
|
|
{
|
|
|
|
$journal->balance = 0;
|
|
|
|
}
|
|
|
|
}
|