further development of the predefinedmutations
This commit is contained in:
@@ -31,6 +31,11 @@ class Ledger extends Model
|
||||
return $this->hasMany(Mutation::class);
|
||||
}
|
||||
|
||||
public function predefinedMutations(): HasMany
|
||||
{
|
||||
return $this->hasMany(PredefinedMutation::class);
|
||||
}
|
||||
|
||||
public function media(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
{
|
||||
return $this->morphMany(Media::class, 'mediable');
|
||||
|
||||
@@ -11,15 +11,14 @@ class PredefinedMutation extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'dynamic_id',
|
||||
'ledger_id',
|
||||
'name',
|
||||
'description',
|
||||
'amount',
|
||||
'type',
|
||||
];
|
||||
|
||||
public function dynamic(): BelongsTo
|
||||
public function ledger(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Dynamic::class);
|
||||
return $this->belongsTo(Ledger::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user