Download the PHP package amranidev/laracombee without Composer

On this page you can find all versions of the php package amranidev/laracombee. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laracombee

Laracombee

Build Status Latest Stable Version License Laravel

Laracombee

Laracombee is a Laravel package for the Recombee recommendation API. It provides a simple Laravel-friendly interface for working with users, items, user-item interactions, and recommendations.

This package is useful for applications such as e-commerce platforms, media libraries, and marketplaces where personalized recommendations can improve engagement and retention.

What is Recombee?

Recombee is an AI-powered recommendation service with a REST API and SDKs for building personalized recommendation systems.

To learn more about how Recombee works, see the official documentation:

Requirements

Installation

Install the package with Composer:

Laravel package discovery registers the service provider and the Laracombee facade alias automatically. You can also import the facade explicitly with use Amranidev\Laracombee\Facades\LaracombeeFacade as Laracombee;.

If you want to publish the configuration file, run:

Set your credentials in .env:

The default configuration reads these variables. If you previously published the configuration, update its database and token entries to use env('RECOMBEE_DATABASE', '') and env('RECOMBEE_TOKEN', ''), or continue supplying those values through your existing configuration.

Configuration

Set your default user and item models in config/laracombee.php:

These classes are used by the package commands.

You can also configure:

Defining Recombee Properties

Each model that should be synchronized with Recombee must define a public static $laracombee property mapping property names to Recombee type strings.

Do the same for your item model. The default mapper uses the Eloquent primary key (getKey()), so custom primary key names are supported. Models must have an identifier before synchronization.

Only declared properties present in toArray() are exported. Eloquent hidden attributes remain excluded. User models must implement Laravel's Authenticatable contract; the built-in commands require Eloquent models.

Usage

Add a user

Add multiple users in a batch

Recommend items to a user

Most methods build a Recombee request, which you pass to send(). Recommendation methods and batch() return a promise directly. Call wait() to execute the SDK request and obtain its result.

The promise defers a synchronous SDK call; it does not provide concurrent network requests. A failed wait() throws the original exception. If you attach otherwise(), its callback receives that exception and can handle or rethrow it.

Commands

Laracombee includes several Artisan commands for managing your Recombee schema and data.

Migrate properties

These commands read the static $laracombee property from the configured model and create the corresponding Recombee properties.

Roll back properties

Seed existing records

You can also set a custom chunk size:

Seeding reads records in database chunks instead of loading the entire table. --chunk must be a positive integer. The type, --to, and --from arguments accept only user or item.

Commands return exit code 0 on success and 1 on validation or execution failure. Seeding stops at the first failed batch; previously completed batches are not rolled back.

Add or drop properties manually

Reset the Recombee database

This command permanently removes all Recombee data, including users, items, properties, ratings, detail views, purchases, bookmarks, and series data. Do not run it in production unless you explicitly intend to wipe the Recombee database.

Generate a custom Laracombee class

This creates a subclass of the package client in your application’s Laracombee directory (normally app/Laracombee). The generator supports nested namespaces, rejects invalid class names, and refuses to overwrite existing files.

Available Methods

Laracombee generally follows Recombee naming conventions.

Users

Items

User-item interactions

Recommendations

Series

Utility

Extending the Package

Resolve the configured singleton through the container or inject it into a controller or service:

The service provider uses LaracombeeConnector to construct the SDK client and injects it into Laracombee. You can supply an SDK client directly for testing or custom construction:

Existing new Laracombee() calls still use the Laravel configuration. Existing AbstractRecombee subclasses can still use the three-argument constructor; an optional fourth SDK client argument is available for injection.

Custom model mapping

Extend ModelMapper to control identifiers or exported properties, then bind it in your application's service provider before resolving the client:

You can override identifier(object $model): string|int, values(object $model): array, and properties(string $model): array. Commands use properties() for schema operations; identifier() and values() control synchronization requests.

Multiple Recombee Databases

Create clients from separate configuration arrays without copying the request or promise implementation:

You can also run php artisan laracombee:new ReportingLaracombee to generate a subclass when you need custom behavior.

Testing

The checked-in lockfile currently targets PHP 8.4 or later for the development tools. On PHP 8.3, use composer update to resolve compatible tools. For Laravel 12 on PHP 8.2, use composer update --with 'orchestra/testbench:^10.0'.

Tests mock the SDK boundary and do not contact Recombee. They cover request construction, deferred execution and failures, model mapping, service registration, command validation, SQLite database chunking, and generated clients. The database tests require pdo_sqlite.

Upgrade Notes

Contributing

Thank you for considering contributing to the project. Please read the contribution guide.

License

This package is open-sourced software licensed under the MIT license.


All versions of laracombee with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
recombee/php-api-client Version ^4.0
guzzlehttp/guzzle Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amranidev/laracombee contains the following files

Loading the files please wait ...