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

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

whilesmart/eloquent-assets
==========================

Polymorphic asset register (equipment, domains, software, subscriptions) for Laravel applications.

1.0.0(1mo ago)050MITPHPPHP ^8.2CI passing

Since Jun 11Pushed 1mo agoCompare

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

READMEChangelog (1)Dependencies (6)Versions (5)Used By (0)

whilesmart/eloquent-assets
==========================

[](#whilesmarteloquent-assets)

A polymorphic asset register for Laravel: one model for everything a business owns, whether physical (equipment, vehicles) or digital (domains, software licenses, subscriptions). Each asset is scoped to an owner (a workspace, organization, user) through [`whilesmart/eloquent-owner-access`](https://github.com/whilesmartphp/eloquent-owner-access), carries a value, and optionally a renewal/expiry date.

Install
-------

[](#install)

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

```

Routes register automatically under the `api` prefix with `auth:sanctum`. Set `ASSETS_REGISTER_ROUTES=false` to mount them yourself.

Owning model
------------

[](#owning-model)

Add the trait to whatever owns assets:

```
use Whilesmart\Assets\Traits\HasAssets;

class Workspace extends Model
{
    use HasAssets;
}

$workspace->assets()->create([
    'name' => 'acme.com',
    'category' => 'domain',
    'value_cents' => 1500,
    'currency' => 'USD',
    'expires_at' => now()->addYear(),
    'renew_interval_months' => 12,
    'details' => ['registrar' => 'Namecheap', 'auto_renew' => true],
]);
```

`reference` (e.g. `AST-00001`) is generated per owner when omitted. Category-specific fields live in the `details` JSON column; common fields (value, status, expiry) are columns.

Endpoints
---------

[](#endpoints)

MethodPathPurposeGET`/api/assets`List (filter by `category`, `status`, `expiring_within`, `q`)POST`/api/assets`CreateGET`/api/assets/{asset}`ShowPUT/PATCH`/api/assets/{asset}`UpdateDELETE`/api/assets/{asset}`Soft deletePOST`/api/assets/{asset}/renew`Advance `expires_at` by `months` (or `renew_interval_months`)POST`/api/assets/{asset}/retire`Mark retiredRenewals
--------

[](#renewals)

`Asset::query()->expiringWithin(30)` returns assets due within 30 days. Host apps can run a scheduled sweep over this scope to send renewal reminders.

Status &amp; category
---------------------

[](#status--category)

`AssetStatus`: `in_use`, `assigned`, `in_stock`, `maintenance`, `expiring`, `expired`, `retired`, `disposed`. `AssetCategory` lists the suggested categories, but `category` is a plain string so new categories need no schema change.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

46d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k4.0k](/packages/leantime-leantime)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k8](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3518.3k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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