Add pilot pay to journals; cleanup payment code #130
This commit is contained in:
@@ -72,12 +72,5 @@ class Airline extends BaseModel
|
||||
$model->icao = strtoupper($model->icao);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Make sure a new journal object is created
|
||||
*/
|
||||
static::created(function(Airline $model) {
|
||||
$model->initJournal(config('phpvms.currency'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,8 @@ trait HashId
|
||||
/**
|
||||
* Register callbacks
|
||||
*/
|
||||
protected static function boot()
|
||||
protected static function bootHashId()
|
||||
{
|
||||
parent::boot();
|
||||
static::creating(function ($model) {
|
||||
if (empty($model->id)) {
|
||||
$model->id = static::createNewHashId();
|
||||
|
||||
@@ -6,6 +6,17 @@ use App\Models\Journal;
|
||||
|
||||
trait JournalTrait
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize a new journal when a new record is created
|
||||
*/
|
||||
public static function bootJournalTrait()
|
||||
{
|
||||
static::created(function ($model) {
|
||||
$model->initJournal(config('phpvms.currency'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Morph to Journal.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user