- How do I install Laracombee in a Laravel 11 project?
- Run `composer require amranidev/laracombee` in your project root. Laravel’s package discovery will auto-register the service provider. No additional steps are needed unless you publish the config file.
- What Laravel versions does Laracombee officially support?
- Laracombee is fully compatible with Laravel 10, 11, and 12. It requires PHP 8.2 or higher. Older Laravel versions (e.g., 9) may need manual adjustments or upgrades.
- Can I use Laracombee for a marketplace where users rate products?
- Yes. Laracombee handles user-item interactions (like ratings, clicks, or purchases) and uses them to generate personalized recommendations. Configure your `Item` model to match your product structure.
- How do I configure the Recombee API credentials?
- Publish the config file with `php artisan vendor:publish --tag=laracombee-config`, then add your Recombee database ID and private token to `config/laracombee.php`. No API key is needed.
- Does Laracombee support offline testing (e.g., CI/CD pipelines)?
- Yes. The package includes fake-based test coverage, eliminating dependency on the live Recombee API. This ensures stable CI/CD pipelines and faster local testing without external calls.
- What if my User or Item models have custom attributes?
- Laracombee maps default attributes (e.g., `id`, `name`) by convention. For custom fields, override the `getRecombeeAttributes()` method in your models to specify which attributes to sync.
- Are there performance trade-offs for large-scale recommendations?
- Laracombee optimizes API calls by batching interactions and recommendations. For high-traffic apps, monitor the `timeout` setting in config and consider caching frequent recommendations.
- How do I fetch recommendations for a specific user?
- Use the `Recommendation` facade: `Recommendation::forUser($userId)->items(10)->get()`. This returns a collection of recommended items based on the user’s interactions and Recombee’s algorithm.
- Can I use Laracombee with Laravel’s queue system for async processing?
- Yes. Sync interactions or fetch recommendations asynchronously by dispatching jobs. The package’s API methods are stateless and thread-safe for queued operations.
- What alternatives exist if I need a self-hosted recommendation system?
- For self-hosted solutions, consider packages like `spatie/laravel-recommendations` or `predis/predis` (for Redis-based collaborative filtering). Laracombee, however, leverages Recombee’s cloud-based AI for scalability.