- 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>
47 lines
927 B
PHP
47 lines
927 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\SpeerpuntStatus;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Speerpunt extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'speerpunten';
|
|
|
|
protected $fillable = [
|
|
'thema_id',
|
|
'naam',
|
|
'beschrijving',
|
|
'eigenaar_id',
|
|
'status',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'status' => SpeerpuntStatus::class,
|
|
];
|
|
}
|
|
|
|
public function thema(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Thema::class);
|
|
}
|
|
|
|
public function eigenaar(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'eigenaar_id');
|
|
}
|
|
|
|
public function projects(): HasMany
|
|
{
|
|
return $this->hasMany(Project::class);
|
|
}
|
|
}
|