PHPackages                             aldiazhar/laravel-agent-network - 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. aldiazhar/laravel-agent-network

ActiveLibrary

aldiazhar/laravel-agent-network
===============================

Multi-level agent commission engine generator for Laravel + Filament

v1.0.2(1mo ago)07MITBladePHP ^8.2

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/aldiazhar/laravel-agent-network)[ Packagist](https://packagist.org/packages/aldiazhar/laravel-agent-network)[ RSS](/packages/aldiazhar-laravel-agent-network/feed)WikiDiscussions main Synced 1w ago

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

Laravel Agent Network
=====================

[](#laravel-agent-network)

Multi-level commission system generator for Laravel + Filament.

Generates migrations, models, events, listeners, and jobs directly into your app. Not a runtime library — generated code is yours to own and modify.

---

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^11 | ^12 | ^13
- Filament ^4 | ^5

---

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

[](#installation)

```
composer require aldiazhar/laravel-agent-network
```

---

Getting Started
---------------

[](#getting-started)

**1. Open the setup wizard**

```
/agent-network/setup

```

Fill in network name, entity name, table prefix, and currency. Click **Generate Files**.

**2. Run migrations**

```
php artisan migrate
```

**3. Create commission rules**

```
/agent-network/commissions

```

**4. Call from your app whenever a transaction occurs**

```
use AgentNetwork\Facades\AgentNetwork;

AgentNetwork::transact(actorId: $agent->id, amount: $order->total, ref: $order->id);
```

---

Commission Types
----------------

[](#commission-types)

### Personal — actor earns from their own transaction

[](#personal--actor-earns-from-their-own-transaction)

```
{ "rate": 5 }
```

```
Actor transacts 1,000,000 × 5% → Actor earns 50,000

```

### Level — upline chain earns based on depth

[](#level--upline-chain-earns-based-on-depth)

```
{ "rates": [{ "level": 1, "rate": 3 }, { "level": 2, "rate": 1 }] }
```

```
Actor transacts 1,000,000:
  Parent      (level 1) earns 30,000
  Grandparent (level 2) earns 10,000

```

Depth is bounded by the number of entries in `rates`. Configure from the dashboard — no code changes needed.

### Group — direct parent earns per transaction

[](#group--direct-parent-earns-per-transaction)

```
{ "rate": 2 }
```

```
Actor transacts 1,000,000 × 2% → Direct parent earns 20,000

```

---

Commission Rules
----------------

[](#commission-rules)

Rules are stored in the database and managed from `/agent-network/commissions`.

- `entity_type = null` → global, applies to all actor types
- `entity_type = 'reseller'` → applies only to actors of that type
- Specific rules always take priority over global rules
- One rule is applied per commission type per transaction

---

Generated Files
---------------

[](#generated-files)

```
database/migrations/
  create_{entity}s_table.php
  create_{prefix}commission_rules_table.php
  create_{prefix}commission_ledgers_table.php
  create_{prefix}transactions_table.php

app/Models/AgentNetwork/
  {Entity}.php            ← actor model (parent / children / ancestors)
  CommissionRule.php
  CommissionLedger.php
  Transaction.php

app/Events/AgentNetwork/
  TransactionRegistered.php
  CommissionEarned.php

app/Listeners/AgentNetwork/
  OnTransactionRegistered.php   ← commission logic
  OnCommissionEarned.php        ← empty hook (notifications, etc.)

app/Jobs/
  ProcessPayoutBatch.php        ← empty hook (bank/wallet transfers)

config/agent-network.php

```

---

Dashboard
---------

[](#dashboard)

Standalone UI at `/agent-network/*`, separate from any Filament panel.

RouteDescription`/agent-network/setup`Generator wizard`/agent-network/commissions`Commission rules (Personal / Level / Group)`/agent-network/network`Actor hierarchy tree`/agent-network/dashboard`Overview stats`/agent-network/transactions`Transaction log`/agent-network/payouts`Pending commissions queue---

Not Included
------------

[](#not-included)

- Auth/middleware for dashboard routes — add your own
- Actual payout transfers — implement in `ProcessPayoutBatch.php`
- Actor management UI — manage actors from your own app
- Link to your `users` table — add the FK yourself if needed

---

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Every ~0 days

Total

3

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/51ce0890960f893d3952a0236192e8c67abab0cca6251eb62cfebf920e0404cf?d=identicon)[alazhar\_pe](/maintainers/alazhar_pe)

---

Top Contributors

[![aldiazhar](https://avatars.githubusercontent.com/u/50188370?v=4)](https://github.com/aldiazhar "aldiazhar (8 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aldiazhar-laravel-agent-network/health.svg)

```
[![Health](https://phpackages.com/badges/aldiazhar-laravel-agent-network/health.svg)](https://phpackages.com/packages/aldiazhar-laravel-agent-network)
```

PHPackages © 2026

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