- Add explicit $table property to all Eloquent models with Dutch names - Fix pivot table names in belongsToMany relationships - Fix seeder: use valid enum values for afhankelijkheden status Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
760 B
PHP
40 lines
760 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\Prioriteit;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Risico extends Model
|
|
{
|
|
protected $table = 'risicos';
|
|
|
|
protected $fillable = [
|
|
'project_id',
|
|
'beschrijving',
|
|
'impact',
|
|
'kans',
|
|
'mitigatie',
|
|
'eigenaar_id',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'impact' => Prioriteit::class,
|
|
'kans' => Prioriteit::class,
|
|
];
|
|
}
|
|
|
|
public function project(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Project::class);
|
|
}
|
|
|
|
public function eigenaar(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'eigenaar_id');
|
|
}
|
|
}
|