atoolo/resource-bundle for indexing structured resources (e.g., CMS content, products, or custom entities), making it suitable for Laravel apps with doctrine/eloquent models or API-driven data.symfony/dependency-injection or symfony/http-kernel). Requires minimal Laravel-specific adaptations (e.g., service aliasing).solarium/solarium or apache/solr-client-php can bridge gaps if needed.atoolo/resource-bundle (v1.7+). If your Laravel app uses custom entities, you’ll need to adapt resource mappings or extend the bundle.SearchQueryDenormalizer).resource.updated → IndexerCommand)./search) can be integrated via Laravel’s route middleware or API resources.| Risk Area | Severity | Mitigation |
|---|---|---|
| Solr Dependency | High | Requires Solr setup (cloud/self-hosted). Test with a staging Solr instance first. |
| Resource Bundle Coupling | Medium | Extend or mock ResourceBundle interfaces if your Laravel models don’t align. |
| Symfony-Laravel Gaps | Low | Use Laravel’s ServiceProvider to alias Symfony services (e.g., SearchClient). |
| Indexing Performance | Medium | Monitor Solr cluster health and Laravel queue workers during peak loads. |
| Schema Mismatches | Medium | Validate Solr schema against IndexSchema2xDocument fields pre-deployment. |
atoolo/resource-bundle resources? Will you need custom Resource implementations?update with locale in v1.13.0).auth-groups) in Solr? The bundle supports this via include_groups.ResourceBundle entities or use DTOs for indexing.created, updated, or deleted events.atoolo-search-bundle's CLI commands or custom queue jobs.symfony/flex or symfony/dependency-injection to bridge Laravel’s container.Bundle class with a Laravel ServiceProvider for autoloading.managed-schema) to match IndexSchema2xDocument fields (e.g., sp_startletter, sp_sortvalue).Phase 1: Setup
composer.json:
composer require sitepark/atoolo-search-bundle
php artisan vendor:publish --tag=atoolo-search-config).solr.yml with your Solr core/collection URL.Phase 2: Resource Mapping
ResourceBundle to map Laravel models to Resource objects.// app/Resources/MyModelResource.php
use Sitepark\Atoolo\ResourceBundle\Resource;
class MyModelResource extends Resource {
public function getIndexableData(): array {
return [
'title' => $this->model->title,
'content' => $this->model->body,
'sp_startletter' => $this->model->title[0] ?? '',
];
}
}
Phase 3: Indexing
php artisan atoolo:search:index --resource=MyModelResource --batch-size=100
// app/Listeners/IndexOnUpdate.php
public function handle(object $event) {
Indexer::indexResource($event->model->toResource());
}
Phase 4: Search Integration
// routes/web.php
Route::get('/search', [SearchController::class, 'index']);
SearchQueryDenormalizer to build Solr queries:
$query = new SearchQuery();
$query->addFilter(new TextFilter('title', 'laravel'));
$results = $searchClient->search($query);
solarium/solarium compatibility).cache:tag) for query results if needed.atoolo/resource-bundle.sp_startletter).atoolo/search-bundle releases (e.g., v1.14.0’s minHitCount feature).atoolo/resource-bundle (v1.7+) and solarium/solarium may need version pinning./solr/#/) to inspect indexes and queries.Sitepark\Atoolo\SearchBundle events.* queries).update with locale (v1.13.0) is configured for multi-language apps.How can I help you explore Laravel packages today?