- 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>
36 lines
648 B
PHP
36 lines
648 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class AuditLog extends Model
|
|
{
|
|
protected $table = 'audit_logs';
|
|
|
|
// Append-only: no updated_at
|
|
const UPDATED_AT = null;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'action',
|
|
'entity_type',
|
|
'entity_id',
|
|
'payload',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'payload' => 'array',
|
|
'created_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|