Clean up API and display of transactions.

This commit is contained in:
James Cole
2025-08-08 20:18:04 +02:00
parent 73512b0365
commit deca4fed56
14 changed files with 435 additions and 444 deletions

View File

@@ -52,4 +52,10 @@ class ALERepository implements ALERepositoryInterface
return $auditLogEntry;
}
public function getForId(string $model, int $modelId): Collection
{
// all Models have an ID.
return AuditLogEntry::where('auditable_id', $modelId)->where('auditable_type', $model)->get();
}
}

View File

@@ -45,6 +45,8 @@ use Illuminate\Support\Collection;
interface ALERepositoryInterface
{
public function getForObject(Model $model): Collection;
public function getForId(string $model, int $modelId): Collection;
public function store(array $data): AuditLogEntry;
}