PHPackages                             linkthrow/laravel-5-predictionio - 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. linkthrow/laravel-5-predictionio

ActiveLibrary

linkthrow/laravel-5-predictionio
================================

Laravel 5 wrapper for PredictionIO v0.9.\*

229PHP

Since Jul 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/linkthrow/laravel-predictionio)[ Packagist](https://packagist.org/packages/linkthrow/laravel-5-predictionio)[ RSS](/packages/linkthrow-laravel-5-predictionio/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel PredictionIO
====================

[](#laravel-predictionio)

\*Based on [michaeljhopkins](https://github.com/michaeljhopkins/PredictionIO-Laravel-Wrapper)

The Laravel PredictionIO library provides a client which offers easy access to a PredictionIO recommendation engine. PredictionIO is an open source machine learning server for software developers to create predictive features, such as personalization, recommendation and content discovery.

Through a small set of simple calls, all server functionality is exposed to your application. You can add users and items, register actions between these users and items and retrieve recommendations deduced from this information by any [`PredictionIO`](http://prediction.io/) recommendation engine. Applications range from showing recommended products in a web shop to discovering relevant experts in a social collaboration network.

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

[](#installation)

- Install library and dependencies:

```
$ composer require "linkthrow/laravel-5-predictionio"
```

- Add a **provider** in `app/config/app.php`:

```
    LinkThrow\LaravelPredictionIO\Provider\PredictionIOServiceProvider::class
```

- Add an **alias** in `app/config/app.php`:

```
    'EngineClient'      => LinkThrow\LaravelPredictionIO\Facades\EngineFacade::class,
        'EventClient'       => LinkThrow\LaravelPredictionIO\Facades\EventFacade::class,
```

- Define your [PredictionIO API endpoint](http://docs.prediction.io/current/tutorials/quickstart-php.html#add-your-app-to-predictionio) in `app/config/services.php`:

```
	'predictionio' => [
		'key' => '0250b3f85ce33284f77c77f36b41010ef2c4fc5c',
		'url' => 'http://localhost:7200'
	],
```

Set a User Record from Your App
-------------------------------

[](#set-a-user-record-from-your-app)

```
// assume you have a user with user ID 5
$response = EventClient::setUser(5);
```

Set an Item Record from Your App
--------------------------------

[](#set-an-item-record-from-your-app)

```
// assume you have a book with ID 'bookId1' and we assign 1 as the type ID for book
$response = EventClient::setItem('bookId1', array('itypes' => 1));
```

Import a User Action (View) form Your App
-----------------------------------------

[](#import-a-user-action-view-form-your-app)

```
// assume this user has viewed this book item
EventClient::recordUserActionOnItem('view', 5, 'bookId1');
```

Retrieving Prediction Result
----------------------------

[](#retrieving-prediction-result)

```
// assume you have created an itemrank engine on localhost:8000
// we try to get ranking of 5 items (item IDs: 1, 2, 3, 4, 5) for a user (user ID 7)

$response = EngineClient::sendQuery(array('uid'=>7, 'iids'=>array(1,2,3,4,5)));

print_r($response);
```

License
=======

[](#license)

This project is licensed using [DBAD](http://www.dbad-license.org/). Go have a blast.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e398ed2a3aef70c486ed7cf01f5571eced0a795b6ce000f7ed18e58aea10111?d=identicon)[linkthrow](/maintainers/linkthrow)

---

Top Contributors

[![hussan-choudhry](https://avatars.githubusercontent.com/u/13449479?v=4)](https://github.com/hussan-choudhry "hussan-choudhry (2 commits)")

### Embed Badge

![Health badge](/badges/linkthrow-laravel-5-predictionio/health.svg)

```
[![Health](https://phpackages.com/badges/linkthrow-laravel-5-predictionio/health.svg)](https://phpackages.com/packages/linkthrow-laravel-5-predictionio)
```

PHPackages © 2026

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