ledgerrz/app/Models/PredefinedMutation.php
Daan Meijer 10bd46a53e
Some checks failed
linter / quality (push) Failing after 1m2s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m5s
tests / ci (8.5) (push) Failing after 1m5s
formatting, juiste use voor UpdateDynamicRequest
2026-06-22 00:10:39 +02:00

39 lines
743 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Str;
class PredefinedMutation extends Model
{
use HasFactory;
protected $fillable = [
'dynamic_id',
'name',
'description',
'amount',
'type',
];
public function dynamic(): BelongsTo
{
return $this->belongsTo(Dynamic::class);
}
protected static function booted(): void
{
static::creating(function ($model) {
$model->uuid = (string) Str::uuid();
});
}
public function getRouteKeyName()
{
return 'uuid';
}
}