- Can I use this bundle in a pure Laravel project without Symfony components?
- The bundle is Symfony-centric, but you can adapt it for Laravel by wrapping it in a custom service provider to bridge Symfony Clock and Doctrine events. Alternatively, consider Laravel-native alternatives like `spatie/laravel-timestamps` if you don’t need Symfony’s abstractions.
- How does this bundle handle manual timestamp overrides in Laravel?
- The bundle respects manually set `createdAt` or `updatedAt` values and won’t overwrite them, similar to Laravel’s `HasTimestamps`. This ensures consistency whether you set timestamps programmatically or let the bundle handle them automatically.
- What Laravel versions support this bundle via Symfony’s Bridge?
- The bundle requires PHP 8.2+, which aligns with Laravel 9.x+. For older Laravel versions (pre-9.x), you’d need to polyfill Symfony Clock or use a Laravel-specific wrapper, as the bundle isn’t officially Laravel-compatible.
- Will this bundle conflict with Gedmo\Timestampable or other timestamping solutions?
- Yes, conflicts can occur since both bundles hook into Doctrine lifecycle events. Disable one or explicitly configure the bundle to avoid overlaps. Test in a staging environment first to identify conflicts early.
- How do I customize column names for `createdAt` and `updatedAt` in Laravel?
- Use the bundle’s optional configuration in `config/packages/andante_timestampable.yaml` to define custom column names (e.g., `created_at` instead of `createdAt`). This mirrors Laravel’s `HasTimestamps` customization but via Symfony’s YAML config.
- Does this bundle work with Laravel’s Eloquent ORM, or only Doctrine?
- This bundle is **Doctrine-only** and won’t work with Eloquent. For Eloquent, use Laravel’s built-in `HasTimestamps` trait or packages like `spatie/laravel-activitylog`. If you’re using API Platform or Doctrine in Laravel, this bundle is a solid alternative.
- How does Symfony Clock improve timestamp accuracy in Laravel?
- Symfony Clock provides a time abstraction layer, making timestamps predictable and testable (e.g., freezing time in unit tests). In Laravel, this translates to more reliable `createdAt`/`updatedAt` values, especially in distributed systems or serverless environments.
- Should I enable `metadata_cache_warmer_enabled` in production for Laravel?
- Only enable this if you’re experiencing cold-start performance issues with Doctrine metadata. For most Laravel apps, the default lazy warmup is sufficient. If enabled, test with `php bin/console cache:clear --no-warmup` to avoid deployment surprises.
- Can I migrate from Laravel’s `HasTimestamps` to this bundle without downtime?
- Yes, adopt it incrementally. Start by adding the trait to new entities, then migrate legacy entities using the bundle’s optional configuration. Use Doctrine migrations to update schema if column names differ (e.g., snake_case vs. camelCase).
- What’s the performance impact of this bundle in high-traffic Laravel APIs?
- The bundle adds minimal overhead, primarily during entity persistence. Benchmark in staging to compare against manual timestamp handling. For high-throughput APIs, ensure your database indexes `createdAt`/`updatedAt` columns for query performance.