34 lines
647 B
PHP
34 lines
647 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Mutation extends Model
|
|
{
|
|
/** @use HasFactory<\Database\Factories\MutationFactory> */
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'ledger_id',
|
|
'user_id',
|
|
'type',
|
|
'amount',
|
|
'description',
|
|
'status',
|
|
];
|
|
|
|
public function ledger(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ledger::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|