ebidtech/doctrine-extensions-bundle
Pros:
Timestampable, Sluggable, Sortable, Tree, Translatable) via Symfony Bundle, aligning with Laravel’s Eloquent ORM’s need for behavioral traits (e.g., soft deletes, timestamps, slugs).created_at, updated_at, or tree hierarchies) to the ORM layer.Cons:
use HasTimestamps with Gedmo’s Timestampable for finer control (e.g., custom column names).Sluggable for SEO-friendly URLs.SoftDeletes trait using Gedmo’s SoftDeleteable.Translatable (though Laravel’s Localization packages may suffice).prePersist). Laravel’s Eloquent uses model observers or accessors/mutators, requiring bridging logic.created_at vs. custom names), conflicting with Laravel conventions.High:
Sluggable updates).Mitigation:
Timestampable) in a sandbox to validate performance and compatibility.spatie/laravel-activitylog for auditing) if Gedmo proves too cumbersome.laravel-doctrine/orm) that bridge the gap.Why Gedmo Over Laravel Native?
Compatibility Validation
globalScopes)?Performance Impact
Model::update()) where Gedmo could cause issues?Long-Term Viability
cviebrock/eloquent-sluggable) that achieve similar goals with lower risk?Target Use Cases:
Sluggable + Translatable for multilingual SEO.Tree extension for categories, menus, or org charts.Timestampable + custom logic for created_at/updated_at with user tracking.SoftDeletes trait if Gedmo’s implementation is more feature-rich.Misalignment:
OnFlush) must be mapped to Laravel’s model events (e.g., saving).Phase 1: Proof of Concept
symfony/console for CLI tools).Timestampable) with a single model.Phase 2: Laravel Adapter Layer
// app/Providers/GedmoServiceProvider.php
public function register()
{
$this->app->bind('gedmo.timestampable.listener', function () {
return new TimestampableListener(); // Adapted for Laravel
});
}
Model::observe(function ($model) {
if (method_exists($model, 'setSlug')) {
$model->setSlug(); // Call Gedmo's method
}
});
Phase 3: Incremental Rollout
Post, Category).DB::enableQueryLog()).HasTimestamps for Gedmo’s Timestampable).doctrine/orm package) and share the same connection.| Step | Task | Dependencies | Risk |
|---|---|---|---|
| 1 | Research alternatives (e.g., spatie/laravel-activitylog) |
None | Low |
| 2 | Set up Symfony-compatible environment | Docker/Symfony CLI | Medium |
| 3 | Test Gedmo extension in isolation | Step 2 | High |
| 4 | Build Laravel adapter layer | Step 3 | High |
| 5 | Integrate with a single model | Step 4 | Medium |
| 6 | Benchmark performance vs. native solutions | Step 5 | Medium |
| 7 | Roll out to production (phased) | Steps 1–6 | High |
How can I help you explore Laravel packages today?