PHPackages                             whilesmart/eloquent-customers - 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. whilesmart/eloquent-customers

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

whilesmart/eloquent-customers
=============================

Polymorphic customer management for Laravel applications.

v1.0.0(4w ago)046[1 issues](https://github.com/whilesmartphp/eloquent-customers/issues)MITPHPPHP ^8.2

Since May 12Pushed 4w agoCompare

[ Source](https://github.com/whilesmartphp/eloquent-customers)[ Packagist](https://packagist.org/packages/whilesmart/eloquent-customers)[ RSS](/packages/whilesmart-eloquent-customers/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

whilesmart/eloquent-customers
=============================

[](#whilesmarteloquent-customers)

Polymorphic customer management for Laravel applications.

Install
-------

[](#install)

```
composer require whilesmart/eloquent-customers
php artisan migrate
```

Use
---

[](#use)

Add `HasCustomers` to any model that should own customers (Workspace, Organization, User, etc.):

```
use Whilesmart\Customers\Traits\HasCustomers;

class Workspace extends Model
{
    use HasCustomers;
}
```

The trait gives you a `morphMany` relation:

```
$workspace->customers()->create([
    'name' => 'Acme Corp',
    'email' => 'billing@acme.com',
    'currency' => 'USD',
]);
```

Endpoints
---------

[](#endpoints)

`GET    /api/customers` — list (filter by `owner_type` + `owner_id`, search via `?q=`) `POST   /api/customers` — create `GET    /api/customers/{id}` — show `PUT    /api/customers/{id}` — update `DELETE /api/customers/{id}` — soft delete

Schema
------

[](#schema)

`customers` table:

columntypeidbigintowner\_type / owner\_idmorphsnamestringemail, phone, company\_name, tax\_id, websitenullable stringsbilling\_address, shipping\_address, notestextcurrencychar(3)is\_activebooleanmetadatajsontimestamps + soft deletesConfig
------

[](#config)

Publish with `php artisan vendor:publish --tag=customers-config`. Override `register_routes`, `route_prefix`, `route_middleware`, and `table` via env or the published config file.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

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

28d ago

### Community

Maintainers

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

---

Top Contributors

[![kofimokome](https://avatars.githubusercontent.com/u/21100923?v=4)](https://github.com/kofimokome "kofimokome (1 commits)")[![nfebe](https://avatars.githubusercontent.com/u/14317775?v=4)](https://github.com/nfebe "nfebe (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/whilesmart-eloquent-customers/health.svg)

```
[![Health](https://phpackages.com/badges/whilesmart-eloquent-customers/health.svg)](https://phpackages.com/packages/whilesmart-eloquent-customers)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11122.5M32](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[mozex/laravel-scout-bulk-actions

Import, flush, and queue-import all your Laravel Scout searchable models at once. Auto-discovers models, runs in bulk, tracks progress.

1437.7k](/packages/mozex-laravel-scout-bulk-actions)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

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