tourze/product-recommend-bundle
Tourze ProductRecommendBundle is a Symfony bundle for adding product recommendation features to PHP applications. It provides configurable recommendation services and integration points to surface related or personalized products, helping you build recommendation lists with minimal setup.
This package is published by Tourze, whose bundles are Symfony-first: product-recommend-bundle is a Symfony bundle (Bundle subclass + DependencyInjection extension), not a Laravel service provider package. Before wiring it in, confirm what it actually ships by reading, in order:
composer.json — required Symfony/Doctrine versions and whether symfony/framework-bundle is a hard dependency.src/*Bundle.php and src/DependencyInjection/ — the service wiring and any autoconfiguration/tagged interfaces.src/Entity/ (or src/Model/) — the Doctrine mappings you will be adopting.src/Resources/config/ — the YAML/PHP service definitions you would have to translate manually.Minimal steps in a Laravel app:
composer require tourze/product-recommend-bundle
php artisan vendor:publish # if a Laravel bridge exists; otherwise skip
Because the bundle registers itself through the Symfony kernel, you have two realistic paths:
The first use case to validate is the simplest one: store a (product, recommended_product, score, type) row and read it back. If you cannot get that working in an afternoon, the package is not ready for your stack.
Doctrine entity adoption. The bundle's value is in its entity definitions. Map them to your existing product table by primary key, and either let Doctrine manage its own tables alongside Eloquent or generate a Laravel migration from the Doctrine schema (php artisan doctrine:schema:to-migration-style tooling, or hand-write it from SHOW CREATE TABLE in a throwaway SQLite database).
Service-layer wrapping. Expose the bundle's recommendation logic behind your own interface so controllers and jobs never touch vendor classes directly:
interface Recommender
{
/** @return RecommendedProduct[] */
public function forProduct(int $productId, int $limit = 10): array;
}
Bind a package-backed implementation in your provider now, and a first-party implementation later if you drop the dependency. This is the single cheapest insurance policy against a 0.0.x dependency.
Asynchronous recomputation. Recommendation generation is a batch concern, not a request concern. Put the recompute behind a queued job (Laravel's queue, or the bundle's console command invoked via Artisan::call / Process), and make the read path a cheap indexed select. Never call the recommender inline in a product page render.
Caching. Treat recommendation output as a cacheable artifact keyed by product_id + strategy + version, with invalidation on recompute. This also masks any performance regressions in the package itself.
Strategy extension. Tourze bundles typically expose tagged-service extension points. If the bundle defines a recommendation-strategy interface, implement it in your app and register via a tagged binding rather than editing vendor code — this survives composer update.
0.0.2...0.0.3). Diff the tags yourself (git diff 0.0.2 0.0.3 --stat) before upgrading; pre-1.0 Tourze releases routinely change signatures without deprecation notices. Pin the exact version ("tourze/product-recommend-bundle": "0.0.3") and never use ^0.0.Kernel::registerBundles(); Laravel has no equivalent. Anything relying on compiler passes, tagged iterators, or Bundle::getContainerExtension() will silently do nothing in Laravel. Grep for TaggedIterator, ServiceLocator, and %parameter% before assuming a feature works.Resources/config/services.php or DependencyInjection/Configuration.php — the supported override path is usually a config key or a tagged interface, not a decorated service.How can I help you explore Laravel packages today?