ledgerrz/app/Models/PredefinedMutation.php
Daan Meijer 1e0782385b
Some checks failed
linter / quality (push) Failing after 1m5s
tests / ci (8.4) (push) Failing after 1m7s
tests / ci (8.5) (push) Failing after 1m5s
tests / ci (8.3) (push) Failing after 12m5s
over naar uuids, policies, predefined mutations aan kunnen passen
2026-06-21 23:09:38 +02:00

38 lines
735 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
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) \Illuminate\Support\Str::uuid();
});
}
public function getRouteKeyName()
{
return 'uuid';
}
}