Fix Dutch model table names and seeder status values
- 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>
This commit is contained in:
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Actie extends Model
|
||||
{
|
||||
protected $table = 'acties';
|
||||
|
||||
protected $fillable = [
|
||||
'commitment_id',
|
||||
'beschrijving',
|
||||
|
||||
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Afhankelijkheid extends Model
|
||||
{
|
||||
protected $table = 'afhankelijkheden';
|
||||
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'afhankelijk_van_project_id',
|
||||
|
||||
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AuditLog extends Model
|
||||
{
|
||||
protected $table = 'audit_logs';
|
||||
|
||||
// Append-only: no updated_at
|
||||
const UPDATED_AT = null;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Budget extends Model
|
||||
{
|
||||
protected $table = 'budgets';
|
||||
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'bedrag',
|
||||
|
||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Commitment extends Model
|
||||
{
|
||||
protected $table = 'commitments';
|
||||
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'besluit_id',
|
||||
|
||||
@@ -11,6 +11,8 @@ class Document extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'documents';
|
||||
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'fase_id',
|
||||
@@ -46,6 +48,6 @@ class Document extends Model
|
||||
|
||||
public function tags(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Tag::class);
|
||||
return $this->belongsToMany(Tag::class, 'document_tag');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Fase extends Model
|
||||
{
|
||||
protected $table = 'fases';
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'type',
|
||||
|
||||
@@ -15,6 +15,8 @@ class Project extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'projects';
|
||||
|
||||
protected $fillable = [
|
||||
'speerpunt_id',
|
||||
'naam',
|
||||
@@ -48,7 +50,7 @@ class Project extends Model
|
||||
|
||||
public function teamleden(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class)
|
||||
return $this->belongsToMany(User::class, 'project_user')
|
||||
->withPivot('rol')
|
||||
->withTimestamps()
|
||||
->using(ProjectUser::class);
|
||||
|
||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Risico extends Model
|
||||
{
|
||||
protected $table = 'risicos';
|
||||
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'beschrijving',
|
||||
|
||||
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class RoadmapItem extends Model
|
||||
{
|
||||
protected $table = 'roadmap_items';
|
||||
|
||||
protected $fillable = [
|
||||
'thema_id',
|
||||
'titel',
|
||||
|
||||
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Role extends Model
|
||||
{
|
||||
protected $table = 'roles';
|
||||
|
||||
protected $fillable = [
|
||||
'naam',
|
||||
'beschrijving',
|
||||
@@ -22,6 +24,6 @@ class Role extends Model
|
||||
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class);
|
||||
return $this->belongsToMany(User::class, 'role_user');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ class Speerpunt extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'speerpunten';
|
||||
|
||||
protected $fillable = [
|
||||
'thema_id',
|
||||
'naam',
|
||||
|
||||
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
protected $table = 'tags';
|
||||
|
||||
protected $fillable = [
|
||||
'naam',
|
||||
'categorie',
|
||||
@@ -14,7 +16,7 @@ class Tag extends Model
|
||||
|
||||
public function documents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Document::class);
|
||||
return $this->belongsToMany(Document::class, 'document_tag');
|
||||
}
|
||||
|
||||
public function kennisArtikelen(): BelongsToMany
|
||||
|
||||
@@ -11,6 +11,8 @@ class Thema extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'themas';
|
||||
|
||||
protected $fillable = [
|
||||
'naam',
|
||||
'beschrijving',
|
||||
|
||||
@@ -16,6 +16,8 @@ class User extends Authenticatable
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
protected $table = 'users';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
@@ -41,12 +43,12 @@ class User extends Authenticatable
|
||||
|
||||
public function roles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Role::class);
|
||||
return $this->belongsToMany(Role::class, 'role_user');
|
||||
}
|
||||
|
||||
public function projects(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Project::class)
|
||||
return $this->belongsToMany(Project::class, 'project_user')
|
||||
->withPivot('rol')
|
||||
->withTimestamps()
|
||||
->using(ProjectUser::class);
|
||||
|
||||
Reference in New Issue
Block a user