PHPackages                             a1boroujerdi/php-recommender - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. a1boroujerdi/php-recommender

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

a1boroujerdi/php-recommender
============================

AI-powered product recommendation system for e-commerce platforms

v1.0.0(1y ago)018MITPHPPHP ^8.1

Since Jun 28Pushed 1y agoCompare

[ Source](https://github.com/a1boroujerdi/php-recommender)[ Packagist](https://packagist.org/packages/a1boroujerdi/php-recommender)[ RSS](/packages/a1boroujerdi-php-recommender/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

EcomAI Recommender
==================

[](#ecomai-recommender)

A Laravel package for AI-powered product recommendations in e-commerce platforms.

Features
--------

[](#features)

- Track user behavior on e-commerce websites
- Analyze user interactions (views, purchases, etc.)
- Generate product recommendations based on AI analysis
- Provide personalized recommendations to users
- Connect to external AI services for advanced recommendations

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ecomai/recommender
```

Publishing the config file
--------------------------

[](#publishing-the-config-file)

```
php artisan vendor:publish --provider="EcomAI\Recommender\RecommenderServiceProvider" --tag="recommender-config"
```

Setting up the database
-----------------------

[](#setting-up-the-database)

Run the migrations to create the necessary tables:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

Configure your AI service connection in your `.env` file:

```
ECOMAI_SERVICE_URL=https://api.youraiservice.com
ECOMAI_API_KEY=your-api-key
ECOMAI_TIMEOUT=5
ECOMAI_TRACK_GUESTS=true

```

Usage
-----

[](#usage)

### Tracking user behavior

[](#tracking-user-behavior)

You can track user behavior through the facade:

```
use EcomAI\Recommender\Facades\Recommender;

// Track when a user views a product
Recommender::trackBehavior(
    $userId,
    $productId,
    'view',
    ['duration' => 30] // Optional metadata
);

// Track when a user adds a product to cart
Recommender::trackBehavior(
    $userId,
    $productId,
    'cart'
);

// Track when a user purchases a product
Recommender::trackBehavior(
    $userId,
    $productId,
    'purchase',
    ['quantity' => 2, 'price' => 99.99]
);
```

### Getting recommendations

[](#getting-recommendations)

```
// Get recommendations for a specific product
$recommendations = Recommender::getProductRecommendations($productId, 5);

// Get personalized recommendations for a user
$recommendations = Recommender::getUserRecommendations($userId, 5);
```

### In Blade templates

[](#in-blade-templates)

```

    You might also like

        @foreach(Recommender::getProductRecommendations($product->id) as $recommendedProduct)

                {{ $recommendedProduct->name }}

                {{ $recommendedProduct->price }}

        @endforeach

```

### API Endpoints

[](#api-endpoints)

The package provides the following API endpoints:

- `POST /api/ecomai/track` - Track user behavior
- `GET /api/ecomai/recommend/product/{productId}` - Get product recommendations
- `GET /api/ecomai/recommend/user/{userId?}` - Get user recommendations

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance49

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

370d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49fb84f644c6acc7c77b3ee64e4d38884db3d6321220581a1ea813d17ebded9a?d=identicon)[a1boroujerdi](/maintainers/a1boroujerdi)

---

Top Contributors

[![a1boroujerdi](https://avatars.githubusercontent.com/u/91847536?v=4)](https://github.com/a1boroujerdi "a1boroujerdi (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/a1boroujerdi-php-recommender/health.svg)

```
[![Health](https://phpackages.com/badges/a1boroujerdi-php-recommender/health.svg)](https://phpackages.com/packages/a1boroujerdi-php-recommender)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[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.

5021.9k](/packages/simplestats-io-laravel-client)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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