- Can I use DoctrineFootprintExtension with Laravel’s Eloquent ORM?
- No, this package is designed for **Doctrine ORM** only and won’t work with Laravel’s Eloquent. If you’re using Eloquent, consider alternatives like `spatie/laravel-activitylog` or `owen-it/laravel-auditlogs` instead.
- How do I disable soft deletes in this package?
- To disable soft deletes, create a **custom trait** that excludes `deletedAt` and `deletedBy` fields. The default trait includes soft delete support via a Doctrine filter, so omitting those fields in your entity will disable it.
- Will this work with Laravel’s built-in `timestamps()` and `softDeletes()`?
- No, conflicts may arise since this package overrides those fields via Doctrine listeners. If you’re using both systems, you’ll need to **choose one approach** or manually sync metadata between them.
- How do I integrate this with Laravel’s Auth system (e.g., `Auth::user()`)?
- The package uses Symfony’s `security.token_storage`, so you’ll need a **custom bridge service** to map it to Laravel’s `Auth::user()`. Example: Create a service that converts the Symfony token to a Laravel user object.
- Is this package compatible with PHP 8.1+ and Doctrine 3.x?
- No, the last release was in **2019** and targets **Doctrine 2.x**, which is end-of-life. You’d need to **fork and update** it for modern PHP/Doctrine versions, or use a maintained alternative.
- Does this add significant performance overhead to queries?
- The package uses Doctrine filters and listeners, which have minimal runtime impact. However, **soft deletes via filters** can affect query performance in large datasets. Benchmark against alternatives if performance is critical.
- How do I install and configure this in Laravel?
- Run `composer require adrianglazer/doctrine-footprint-extension`, then configure the **Doctrine filter** in `config/packages/doctrine.yaml` and register the **FootprintListener** in `config/services.yaml` with `@security.token_storage`.
- What if I only need audit logs for some entities, not all?
- Apply the `FootprintTrait` **only to entities** requiring auditing. The package won’t affect entities without the trait, making it flexible for partial adoption.
- Are there better alternatives for Laravel audit logging?
- Yes, if you’re using **Eloquent**, consider `spatie/laravel-activitylog` (modern, feature-rich) or `owen-it/laravel-auditlogs` (supports soft deletes). This package is niche for **Doctrine ORM** setups.
- How do I handle cases where no user is authenticated (e.g., API calls)?
- The package relies on `security.token_storage` to fetch the current user. If no user is logged in, it may set `NULL` for user fields. You can **override the listener** or use middleware to ensure a default user (e.g., a system account).