- 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>
42 lines
842 B
PHP
42 lines
842 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\ActieStatus;
|
|
use App\Enums\Prioriteit;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Actie extends Model
|
|
{
|
|
protected $table = 'acties';
|
|
|
|
protected $fillable = [
|
|
'commitment_id',
|
|
'beschrijving',
|
|
'eigenaar_id',
|
|
'deadline',
|
|
'status',
|
|
'prioriteit',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'status' => ActieStatus::class,
|
|
'prioriteit' => Prioriteit::class,
|
|
'deadline' => 'date',
|
|
];
|
|
}
|
|
|
|
public function commitment(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Commitment::class);
|
|
}
|
|
|
|
public function eigenaar(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'eigenaar_id');
|
|
}
|
|
}
|