PHPackages                             jbaron-mx/laravel-recombee - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jbaron-mx/laravel-recombee

ActiveLibrary[API Development](/categories/api)

jbaron-mx/laravel-recombee
==========================

An expressive fluent API wrapper around Recombee's SDK to use within Laravel applications

0.2.2(1mo ago)72.5k↓37.1%4[1 PRs](https://github.com/jbaron-mx/laravel-recombee/pulls)MITPHPPHP ^8.0CI passing

Since Jul 14Pushed 1w ago1 watchersCompare

[ Source](https://github.com/jbaron-mx/laravel-recombee)[ Packagist](https://packagist.org/packages/jbaron-mx/laravel-recombee)[ Docs](https://github.com/jbaron-mx/laravel-recombee)[ RSS](/packages/jbaron-mx-laravel-recombee/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (5)Dependencies (28)Versions (11)Used By (0)

[![](https://camo.githubusercontent.com/718df334d8a452f035693e5e47e875b10f7cfe0bab5ccee3ae86ece8a8468c17/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532305265636f6d6265652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6a6261726f6e2d6d782532466c61726176656c2d7265636f6d626565267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d5365616d6c6573732b696e746567726174696f6e2b6f662b41492d706f77657265642b7265636f6d6d656e646174696f6e73266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/718df334d8a452f035693e5e47e875b10f7cfe0bab5ccee3ae86ece8a8468c17/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532305265636f6d6265652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6a6261726f6e2d6d782532466c61726176656c2d7265636f6d626565267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d5365616d6c6573732b696e746567726174696f6e2b6f662b41492d706f77657265642b7265636f6d6d656e646174696f6e73266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Latest Stable Version](https://camo.githubusercontent.com/89a76c1313244f38bb2e5019a03cd61db2472977b1d80942a10f8d2bc05ca281/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6261726f6e2d6d782f6c61726176656c2d7265636f6d6265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jbaron-mx/laravel-recombee)[![GitHub Tests Action Status](https://camo.githubusercontent.com/811ad30e5dfcf908e81a4cbcf939c2949cb5eb31576f6d4f0f28658762f3550b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6261726f6e2d6d782f6c61726176656c2d7265636f6d6265652f72756e2d74657374732e796d6c3f6c6162656c3d7465737473266272616e63683d6d61696e)](https://github.com/jbaron-mx/laravel-recombee/actions/workflows/run-tests.yml?query=branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5b87c98e096bcae113c9eb05257ec6edd876e967742d621ffcf42063f359e713/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6261726f6e2d6d782f6c61726176656c2d7265636f6d6265652f7068702d63732d66697865722e796d6c3f6c6162656c3d636f64652532307374796c65266272616e63683d6d61696e)](https://github.com/jbaron-mx/laravel-recombee/actions/workflows/php-cs-fixer.yml?query=branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/73245f45233533fba4c20e7065b1147c610676d8102b01484b4a6d66e3ebd057/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6261726f6e2d6d782f6c61726176656c2d7265636f6d6265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jbaron-mx/laravel-recombee)

---

[Recombee](https://www.recombee.com/) is an **AI-powered recommendation engine** that delivers amazing user experiences with recommendations based on users' behavior and interests.

This package is a [Recombee PHP SDK](https://github.com/Recombee/php-api-client) wrapper for Laravel. It provides an **expressive fluent API** to seamlessly integrate **personalized recommendations** into your application in the *Laravel way*. Heavily inspired in [Laravel Scout](https://github.com/laravel/scout/).

---

Supports
--------

[](#supports)

- **PHP:** 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
- **Laravel:** 8, 9, 10, 11, 12, 13

Prerequisites
-------------

[](#prerequisites)

1. Create an account in [Recombee](https://www.recombee.com/).
2. Create a database within your account.

Installation &amp; Setup
------------------------

[](#installation--setup)

Install with Composer:

```
composer require jbaron-mx/laravel-recombee
```

Publish config file:

```
php artisan vendor:publish --tag="recombee-config"
```

Add to your `.env` file:

> Replace the values with your database details from Recombee.

```
RECOMBEE_DATABASE="my-store"
RECOMBEE_TOKEN="token"
RECOMBEE_REGION="us-west"
```

Add your corresponding models to your `config/recombee.php`:

```
'user' => App\Models\User::class,
'item' => App\Models\Product::class,
```

Add `Recommendable` trait to your corresponding models:

```
use Baron\Recombee\Recommendable;

class User extends Authenticatable
{
    use Recommendable;
    ...
```

```
use Baron\Recombee\Recommendable;

class Product extends Model
{
    use Recommendable;
    ...
```

Quick Usage
-----------

[](#quick-usage)

> For full documentation please visit the [wiki](https://github.com/jbaron-mx/laravel-recombee/wiki).

Create properties in your Recombee database:

```
use Baron\Recombee\Facades\Recombee;

// Create a user property
Recombee::user()
    ->property('active', 'boolean')    // 2nd argument is optional, string by default.
    ->save();

// Create multiple user properties
Recombee::user()->properties([
    'name' => 'string',
    'age' => 'int',
    'active' => 'boolean',
])->save();

// Create an item property
Recombee::item()
    ->property('available', 'boolean')    // 2nd argument is optional, string by default.
    ->save();

// Create multiple item properties
Recombee::item()->properties([
    'description' => 'string',
    'price' => 'double',
    'available' => 'boolean',
])->save();
```

Import users and items:

> For batch import, please visit the [Batch Import](https://github.com/jbaron-mx/laravel-recombee/wiki/3.-Batch-Import) section in the wiki.

```
use Baron\Recombee\Facades\Recombee;

// Import a user
Recombee::user($userId, [
    'name' => 'John Doe',
    'age' => 29,
    'active' => true,
])->save();

// Import a user via model
User::first()->recommendable();

// Import an item
Recombee::item($itemId, [
    'description' => 'Magic Keyboard 3',
    'price' => 59.99,
    'available' => true,
])->save();

// Import an item via model
Product::first()->recommendable();
```

Retrieve users and items:

> get() returns an instance of `Collection` for which all its convenient methods are available, refer to [Laravel Docs for all available methods](https://laravel.com/docs/master/collections#available-methods).

```
use Baron\Recombee\Facades\Recombee;

// Basic get limited to 25 results by default
Recombee::user()->get();
Recombee::item()->get();

// Same methods are available for users and items
Recombee::item()
    ->select('description', 'price', 'available')   // Select these properties only
    ->take(50)                                      // Limited to 50 results
    ->option('filter', "'price' > 25")              // Filtered by price
    ->get()
```

Create interactions:

```
use Baron\Recombee\Facades\Recombee;

// User has viewed this item
Recombee::user($userId)->viewed($itemId)->save();

// User has purchased this item
Recombee::user($userId)->purchased($itemId)->save();

// User has rated this item (Scale from -1.0 to 1.0, see docs)
Recombee::user($userId)->rated($itemId, 0.5)->save();

// User has added this item to his cart
Recombee::user($userId)->carted($itemId)->save();

// User has bookmarked this item
Recombee::user($userId)->bookmarked($itemId)->save();

// User has partially viewed this item (Scale from 0 to 1, see docs)
Recombee::user($userId)->viewedPortion($itemId, 0.5)->save();
```

Get personalized recomendations:

```
use Baron\Recombee\Facades\Recombee;

// Recommended items for a given user, typically used in a "Picked just for you" section.
Recombee::user($userId)->recommendItems()->take(50)->get();

// Recommended users for another given user, based on the user's past interactions and values of properties.
Recombee::user($userId)->recommendUsers()->get();

// Recommended items that are related to a given item, typically used in a "Similar Products" section.
Recombee::item($itemId)->recommendItems()->get();

// Recommended users that are likely to be interested in a given item.
Recombee::item($itemId)->recommendUsers()->get();
```

Documentation
-------------

[](#documentation)

Please visit the [wiki](https://github.com/jbaron-mx/laravel-recombee/wiki) for full documentation.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance95

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~352 days

Total

5

Last Release

44d ago

PHP version history (2 changes)0.1.0PHP ^8.0

0.2.0PHP ^8.0|^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11150471?v=4)[Jesus Baron](/maintainers/jbaron-mx)[@jbaron-mx](https://github.com/jbaron-mx)

---

Top Contributors

[![jbaron-mx](https://avatars.githubusercontent.com/u/11150471?v=4)](https://github.com/jbaron-mx "jbaron-mx (79 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")[![Xoshbin](https://avatars.githubusercontent.com/u/1606070?v=4)](https://github.com/Xoshbin "Xoshbin (1 commits)")

---

Tags

laravelphprecombeerecommendation-systemrecommenderlaraveljbaron-mxlaravel-recombee

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jbaron-mx-laravel-recombee/health.svg)

```
[![Health](https://phpackages.com/badges/jbaron-mx-laravel-recombee/health.svg)](https://phpackages.com/packages/jbaron-mx-laravel-recombee)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M101](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.9k3](/packages/defstudio-telegraph)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
