symfony/console, symfony/http-foundation), the bundle’s reliance on Symfony’s Doctrine ORM, EventDispatcher, and Annotation system (via doctrine/annotations) makes direct adoption non-trivial.EventListener for indexing triggers, EntityManager hooks). Laravel alternatives like Scout, Algolia Scout, or Laravel Elasticsearch are more mature for this use case.@Search\Item annotation would require a custom attribute-to-annotation bridge or manual migration.SearchableEntityInterface) would need rewriting to fit Laravel’s Eloquent ORM or Query Builder.KernelEvents (e.g., postPersist) won’t map cleanly to Laravel’s model events (creating, saved). Custom event listeners would be required.loader property (e.g., "some.service:method") assumes Symfony’s service container. Laravel’s bindings or facades would need adaptation.EntityListener won’t work; Laravel’s Observers or Model Events would need custom logic.LocalizedSearchableEntityInterface relies on Symfony’s translation components, which Laravel lacks natively.shouldQueue) would need alignment.postPersist events map to Laravel’s saved/created events? Are there gaps in functionality (e.g., soft deletes, mass updates)?LanguageInterface?| Symfony Feature | Laravel Equivalent | Feasibility |
|---|---|---|
| Doctrine ORM | Eloquent ORM | Medium (requires adapter layer) |
| Annotation System | PHP Attributes (PHP 8+) | Low (custom parsing needed) |
| EventDispatcher | Model Events / Observers | High (direct mapping possible) |
| Service Container | Laravel’s IoC Container | High (bindings/facades) |
| Kernel Events | Laravel’s booted / registered |
Medium (indirect triggers) |
#[\Search\Item]).Model Observers to trigger Elasticsearch updates.Post) to validate indexing/deleting logic.Loader system (e.g., SearchLoader facade).spatie/laravel-translatable).postSaved: queue SearchIndexer).SearchRepository.Artisan).SearchTestCase for Pest/PHPUnit).search_config table or JSON column).#[Search\Item(index: "products")]
class Product {}
→ Stored as Product::searchConfig = ['index' => 'products'].postPersist → saved (Eloquent)postRemove → deletedpostFlush → saved (batch updates)^8.0) and spatie/laravel-translatable (if needed).doctrine/annotations) would need forking or replacement. Example:
doctrine/annotations with php-attributes + custom parser.symfony/event-dispatcher with Laravel’s native events.post-autoload-dump).Log::error() instead of Symfony’s ErrorHandler).How can I help you explore Laravel packages today?