PHPackages                             sam0hack/distributor - 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. sam0hack/distributor

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

sam0hack/distributor
====================

This is a 6 layers referral income/points distributor system.

2.0.x-dev(4y ago)06PHPPHP &gt;=7.4

Since Aug 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sam0hack/Distrubutor)[ Packagist](https://packagist.org/packages/sam0hack/distributor)[ RSS](/packages/sam0hack-distributor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Distributor
===========

[](#distributor)

###### Laravel Plugin for 6 level referral system.

[](#laravel-plugin-for-6-level-referral-system)

**Configure with Composer**

`"repositories": [ { "type": "path", "url": "Distributor" } ]`

**OR**

**Configure with Composer as dev-package**

*Recommended if you want to make changes in the plugin*

`    "repositories": { "dev-package": { "type": "path", "url": "Distributor", "options": { "symlink": true } } }`

Make sure you have Distributor plugin in same folder

Run `composer require "sam0hack/Distributor`

**Installation**

Run `php artisan migrate`

Run `php artisan distributor:install-settings`*This will create basic settings*

Run `php artisan distributor:generation-zero`

*This will create 6 Generation zero users, those users will be the highest level users in the referral system.*

**Usage**

**To get Random Generation Zero Referral Code**

`Distributor::getRandomGenZeroCode();`

**To add new in the Distributor system**

`Distributor::add_distributor(new_user_id,'referral_code');`This will create 6 level layer and a wallet for this new\_user\_id

**Make Transaction**

`DistributorTransaction::distributeAmount(user_id,amount);`

This will distribute the amount into 6 upper levels of this user\_id

\*\* Get User code \*\* `Distributor::getCode(user_id);`

\###Wallet

**GET Methods**

**Get Total Withdrawal of the user**

`DistributorWallet::GetTotalWithdrawal('user_id');`

**Get Total Earnings of the user**

`DistributorWallet::GetTotalEarning('user_id');`

**Get Total Balance of the user**

`DistributorWallet::GetBalance('user_id');`

**Set Methods**

**Set Withdrawal Amount**`DistributorWallet::SetTotalwithdrawal(user_id,Withdrawal_amount);`

**Set Balance**

`DistributorWallet::SetBalance(user_id,$amount);`

**Set Earnings**

`DistributorWallet::SetTotalEarnings(user_id,$amount);`

### Database

[](#database)

**Migration Files**

- 2019\_11\_01\_000000\_distributor //for handling referral
- 2019\_11\_01\_000000\_distributor\_code //Referral codes
- 2019\_11\_01\_000000\_distributor\_earning\_from\_user //Track earning from users
- 2019\_11\_01\_000000\_distributor\_generation\_zero\_user //Generation zero user. Highest initial level users (at-least 6 users are required)
- 2019\_11\_01\_000000\_distributor\_level //Handle user levels
- 2019\_11\_01\_000000\_distributor\_setting //Settings like percentage and referral limit
- 2019\_11\_01\_000000\_distributor\_transaction //Track of every transaction
- 2019\_11\_01\_000000\_distributor\_wallet //User wallet for keep track of earning and withdrawals

**Test**

Run test `./vendor/bin/phpunit`

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

1664d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/df4fd648ee26ac70b9aa91e7777ab60668f7b33d635b6738b0b661b29d246dd8?d=identicon)[sam0hack](/maintainers/sam0hack)

---

Top Contributors

[![sam0hack](https://avatars.githubusercontent.com/u/5379650?v=4)](https://github.com/sam0hack "sam0hack (9 commits)")

---

Tags

laraveldistributor

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sam0hack-distributor/health.svg)

```
[![Health](https://phpackages.com/badges/sam0hack-distributor/health.svg)](https://phpackages.com/packages/sam0hack-distributor)
```

###  Alternatives

[stepanenko3/nova-cards

A Laravel Nova info cards.

33143.0k](/packages/stepanenko3-nova-cards)

PHPackages © 2026

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