adrianglazer/doctrine-footprint-extension
Doctrine extension to auto-track entity create/update/delete with timestamps and usernames. Adds created_at/by, updated_at/by, deleted_at/by via a single trait + event subscriber, plus a Doctrine filter for soft deletes.
doctrine/dbal or doctrine/orm alongside Laravel) for audit logging without reinventing the wheel.created_at, updated_at, etc. fields).timestamps() and softDeletes().Auth::user()), requiring manual mapping of security.token_storage to Laravel’s auth.timestamps() if entities use both systems.security.token_storage must be bridged to Laravel’s Auth facade or a custom service.laravel-auditlog, spatie/laravel-activitylog) if Doctrine is not a hard requirement.security.token_storage map to Laravel’s Auth? Requires custom glue code.spatie/laravel-activitylog (Eloquent-focused, modern).owen-it/laravel-auditlogs (supports soft deletes, timestamps).security.token_storage compatibility).Illuminate/Auth) is not natively supported.security.token_storage to Laravel’s Auth::user().// src/Service/DoctrineAuthBridge.php
class DoctrineAuthBridge {
public function getUser(): ?User {
return Auth::user(); // Map Symfony token to Laravel user
}
}
config/packages/doctrine.yaml.config/services.yaml with the auth bridge as an argument.use Glazer\DoctrineFootprintExtension\Traits\FootprintTrait;
class Product {
use FootprintTrait;
// ...
}
security.token_storage can resolve the current user (may require middleware or a custom guard).softDeletes(), conflicts may arise with Doctrine’s soft-delete filter. Decide on a single source of truth.created_by, updated_by for query optimization.| Scenario | Impact | Mitigation |
|---|---|---|
| Auth user resolution fails | Timestamps set but no user | Fallback to a default user (e.g., system). |
| Doctrine filter misconfigured | No audit logs recorded | Add validation in tests. |
| PHP/Doctrine version conflict | Package breaks | Pin versions or fork. |
| Conflict with Eloquent | Timestamp duplication | Disable Laravel’s timestamps() for Doctrine entities. |
security.token_storage.How can I help you explore Laravel packages today?