PHPackages                             tsubasarcs/laravel-recommendation - 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. [Database &amp; ORM](/categories/database)
4. /
5. tsubasarcs/laravel-recommendation

ActiveLibrary[Database &amp; ORM](/categories/database)

tsubasarcs/laravel-recommendation
=================================

cp member get member database package

5.5.10(7y ago)249MITPHPPHP &gt;=7.1

Since Apr 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tsubasarcs/laravel-recommendation)[ Packagist](https://packagist.org/packages/tsubasarcs/laravel-recommendation)[ Docs](https://github.com/tsubasarcs/laravel-recommendation)[ RSS](/packages/tsubasarcs-laravel-recommendation/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (13)Used By (0)

Laravel Recommendation
======================

[](#laravel-recommendation)

> This package provides to generate user unique code with Laravel.

Installation
============

[](#installation)

Currently this package only for laravel 5.5.

### Install via composer

[](#install-via-composer)

```
    $ composer require tsubasarcs/laravel-recommendation

```

### Publish Migration and Config

[](#publish-migration-and-config)

Run the following to publish the migrations on your terminal:

```
    $ php artisan vendor:publish --provider="Tsubasarcs\Recommendations\RecommendationServiceProvider" --tag="migrations"
```

If you want to change some parameters, you can run the following to publish the config on your terminal:

```
    $ php artisan vendor:publish --provider="Tsubasarcs\Recommendations\RecommendationServiceProvider" --tag="config"
```

Setting
=======

[](#setting)

### Model Recommendation

[](#model-recommendation)

If you want to do customize model and column, please check Recommendation Model "code" column to prevent code duplicate.

```
// config/recommendation.php
...
    'model' => [
        'name' => \Tsubasarcs\Recommendations\Recommendation::class,
        'code_column' => 'code',
    ],
```

Model Recommendation is default belongs to `\Tsubasarcs\Recommendations\IlluminateUser::class`, You need to change it to your application model.

```
// config/recommendation.php
...
    'relation_model' => \Tsubasarcs\Recommendations\IlluminateUser::class,
```

### Default attributes

[](#default-attributes)

Generating Code type and length attributes can be customize via setting default key value.

```
// config/recommendation.php
...
    'default' => [
        'type' => 1,
        'length' => 10,
    ],
```

Code structure has three parts, `prefix`, `timestamp` and `code`.
You can decide to join `prefix` and `timestamp` or not and custom `symbol` between part and part.

```
// config/recommendation.php
...
    // Default only code.
    'code_structure' => [
        'prefix' => '',
        'timestamp' => false,
        'symbol' => '-'
    ]
```

Usage
=====

[](#usage)

### Generating Code

[](#generating-code)

Code Facade end point is `generate()`, it will return an array.

```
    Code::generate();
    // [['type' => 1,'code' => 'X6nbxJ8DHk']];
```

If you are not using endpoint, it will return `CodeService` instance.

```
    Code::type(2);
    // Tsubasarcs\Recommendations\CodeService {#result: [], #times: 1, #type: 2, #length: 10};
```

\#Example

```
    Code::prefix('cp')
        ->timestamp(true)
        ->symbol('@')
        ->type(2)
        ->length(15)
        ->times(2)
        ->generate();
    // [
    //      ["type" => 2, "code" => "cp@1557454693@4PZHxJXdM7K8OBo"],
    //      ["type" => 2, "code" => "cp@1557454693@rnExFAeD18GDMhs"]
    // ];

    'X6nbxJ8DHk'
    // default

    'cp-X6nbxJ8DHk'
    // config('recommendation.code_structure.prefix') == 'cp'

    '1557287118-Gnr3olcOD6'
    // config('recommendation.code_structure.timestamp') == true

    'cp_1557287118_X6nbxJ8DHk'
    // config('recommendation.code_structure.prefix') == 'cp'
    // config('recommendation.code_structure.timestamp') == true
    // config('recommendation.code_structure.symbol') == '_'
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~1 days

Total

12

Last Release

2560d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/269a33966a703bc35b0a80ca0013bae2664bc713e35b71fbf8066f368f88fecd?d=identicon)[tsubasarcs](/maintainers/tsubasarcs)

---

Top Contributors

[![seanshih-parenting](https://avatars.githubusercontent.com/u/32083062?v=4)](https://github.com/seanshih-parenting "seanshih-parenting (36 commits)")[![Mombuyish](https://avatars.githubusercontent.com/u/8007787?v=4)](https://github.com/Mombuyish "Mombuyish (1 commits)")[![tsubasarcs](https://avatars.githubusercontent.com/u/19386279?v=4)](https://github.com/tsubasarcs "tsubasarcs (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tsubasarcs-laravel-recommendation/health.svg)

```
[![Health](https://phpackages.com/badges/tsubasarcs-laravel-recommendation/health.svg)](https://phpackages.com/packages/tsubasarcs-laravel-recommendation)
```

###  Alternatives

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

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