- Can I use ibexa/search directly in a Laravel project without Ibexa DXP?
- No, this package is tightly coupled with Ibexa DXP’s content repository and Symfony architecture. You’ll need to build custom Laravel adapters (e.g., service providers, query builders) to abstract Ibexa’s logic or use Symfony bridges like `symfony/dependency-injection`. Direct integration is non-trivial and may require significant refactoring.
- What Laravel versions support ibexa/search with minimal conflicts?
- Laravel 10+ (PHP 8.3+) is the best fit due to PHP version alignment, but Symfony dependencies (e.g., `symfony/*`) may conflict with Laravel’s native components. Use `composer replace` or Symfony bridges to mitigate conflicts. Older Laravel versions (e.g., 9.x) may need Ibexa forks or manual patches.
- How do I configure ibexa/search to work with Elasticsearch in Laravel?
- Ibexa’s search backend (Elasticsearch/Solr) can be configured via Ibexa’s Symfony bundle, but you’ll need to wrap it in Laravel’s service container. Start by installing `ibexa/ibexa-symfony-bundle` and use Laravel’s `bind()` method to expose Ibexa’s `SearchService` as a Laravel service. Example: `app()->bind('ibexa.search', fn($app) => $app->make(IbexaSearchService::class));`
- Are there performance trade-offs when using Ibexa’s search in Laravel?
- Yes, Ibexa’s search layer adds overhead due to its Symfony-centric architecture. Benchmark queries against direct Elasticsearch/Solr clients (e.g., `elasticsearch/elasticsearch` for Laravel). If latency is critical, consider bypassing Ibexa’s bundle entirely and using Laravel Scout or a dedicated search package.
- What’s the best way to handle Ibexa’s content-aware queries in Laravel?
- Ibexa’s queries rely on its content repository model (e.g., filtering by `ContentType`, `language`, or `metadata`). Create Laravel-specific query builders that translate Laravel’s Eloquent or custom queries into Ibexa’s `Query` objects. For example, map a Laravel `whereHas` clause to Ibexa’s `Query::filter()` method using a custom adapter.
- Does ibexa/search support Laravel’s Scout for Algolia/Meilisearch?
- No, this package is Ibexa-specific and doesn’t integrate with Scout. If you’re using Algolia or Meilisearch, Scout is a better choice. For Elasticsearch/Solr, consider Laravel’s `elasticsearch/elasticsearch` package or Scout’s Elasticsearch driver instead of wrapping Ibexa’s bundle.
- How do I handle dependency conflicts between Symfony and Laravel?
- Use `composer replace` to override Symfony packages with Laravel-compatible versions (e.g., `composer replace symfony/routing laravel/framework`). Alternatively, install Symfony packages as dev dependencies and use bridges like `symfony/http-foundation` only where needed. Test thoroughly for routing or HTTP layer conflicts.
- Can I use ibexa/search in a headless Laravel API for Ibexa CMS?
- Yes, but focus on exposing Ibexa’s search via a Laravel API layer. Use Symfony’s `HttpFoundation` as a bridge for Ibexa’s HTTP responses or build custom JSON responses. Avoid mixing Laravel’s routing with Ibexa’s Symfony router by abstracting Ibexa’s endpoints behind Laravel controllers.
- What are the licensing implications of using ibexa/search in Laravel?
- The package is dual-licensed under GPLv2 (open-source) or Ibexa BUL (enterprise). GPLv2 requires your project to be open-source, while BUL requires an Ibexa DXP subscription. Review your project’s licensing needs and ensure compliance with Ibexa’s terms before integration.
- How do I test ibexa/search in a Laravel application?
- Mock Ibexa’s `SearchService` and `Query` objects in Laravel’s testing environment using PHPUnit’s mocking tools. For example, create a fake search service in your tests that mimics Ibexa’s methods (e.g., `find()`, `filter()`). Use Laravel’s `Mockery` or `createMock()` to simulate Ibexa’s dependencies without a full Ibexa instance.