initial commit

This commit is contained in:
bastien
2026-06-28 12:29:53 +02:00
parent 03e85d2f9d
commit b2443b654c
220 changed files with 24969 additions and 1 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
#[Fillable(['actor_type', 'actor_id', 'organization_id', 'establishment_id', 'action', 'target_type', 'target_id', 'before_data', 'after_data', 'ip_address'])]
class AuditLog extends Model
{
public const UPDATED_AT = null;
protected function casts(): array
{
return [
'before_data' => 'array',
'after_data' => 'array',
'created_at' => 'datetime',
];
}
public function actor(): MorphTo
{
return $this->morphTo();
}
public function organization(): BelongsTo
{
return $this->belongsTo(Organization::class);
}
public function establishment(): BelongsTo
{
return $this->belongsTo(Establishment::class);
}
public function target(): MorphTo
{
return $this->morphTo();
}
}