{"id":51045270,"url":"https://github.com/whilesmartphp/eloquent-assets","last_synced_at":"2026-06-22T13:02:09.691Z","repository":{"id":364085160,"uuid":"1265165873","full_name":"whilesmartphp/eloquent-assets","owner":"whilesmartphp","description":"Polymorphic asset register (equipment, domains, software, subscriptions) for Laravel.","archived":false,"fork":false,"pushed_at":"2026-06-11T14:30:43.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2026-06-11T16:17:37.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whilesmartphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T14:21:59.000Z","updated_at":"2026-06-11T12:43:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/whilesmartphp/eloquent-assets","commit_stats":null,"previous_names":["whilesmartphp/eloquent-assets"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/whilesmartphp/eloquent-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whilesmartphp","download_url":"https://codeload.github.com/whilesmartphp/eloquent-assets/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-assets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34649822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-22T13:02:08.718Z","updated_at":"2026-06-22T13:02:09.683Z","avatar_url":"https://github.com/whilesmartphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# whilesmart/eloquent-assets\n\nA polymorphic asset register for Laravel: one model for everything a business owns, whether\nphysical (equipment, vehicles) or digital (domains, software licenses, subscriptions). Each\nasset is scoped to an owner (a workspace, organization, user) through\n[`whilesmart/eloquent-owner-access`](https://github.com/whilesmartphp/eloquent-owner-access),\ncarries a value, and optionally a renewal/expiry date.\n\n## Install\n\n```\ncomposer require whilesmart/eloquent-assets\nphp artisan migrate\n```\n\nRoutes register automatically under the `api` prefix with `auth:sanctum`. Set\n`ASSETS_REGISTER_ROUTES=false` to mount them yourself.\n\n## Owning model\n\nAdd the trait to whatever owns assets:\n\n```php\nuse Whilesmart\\Assets\\Traits\\HasAssets;\n\nclass Workspace extends Model\n{\n    use HasAssets;\n}\n\n$workspace-\u003eassets()-\u003ecreate([\n    'name' =\u003e 'acme.com',\n    'category' =\u003e 'domain',\n    'value_cents' =\u003e 1500,\n    'currency' =\u003e 'USD',\n    'expires_at' =\u003e now()-\u003eaddYear(),\n    'renew_interval_months' =\u003e 12,\n    'details' =\u003e ['registrar' =\u003e 'Namecheap', 'auto_renew' =\u003e true],\n]);\n```\n\n`reference` (e.g. `AST-00001`) is generated per owner when omitted. Category-specific fields\nlive in the `details` JSON column; common fields (value, status, expiry) are columns.\n\n## Endpoints\n\n| Method | Path | Purpose |\n|--------|------|---------|\n| GET | `/api/assets` | List (filter by `category`, `status`, `expiring_within`, `q`) |\n| POST | `/api/assets` | Create |\n| GET | `/api/assets/{asset}` | Show |\n| PUT/PATCH | `/api/assets/{asset}` | Update |\n| DELETE | `/api/assets/{asset}` | Soft delete |\n| POST | `/api/assets/{asset}/renew` | Advance `expires_at` by `months` (or `renew_interval_months`) |\n| POST | `/api/assets/{asset}/retire` | Mark retired |\n\n## Renewals\n\n`Asset::query()-\u003eexpiringWithin(30)` returns assets due within 30 days. Host apps can run a\nscheduled sweep over this scope to send renewal reminders.\n\n## Status \u0026 category\n\n`AssetStatus`: `in_use`, `assigned`, `in_stock`, `maintenance`, `expiring`, `expired`,\n`retired`, `disposed`. `AssetCategory` lists the suggested categories, but `category` is a\nplain string so new categories need no schema change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhilesmartphp%2Feloquent-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhilesmartphp%2Feloquent-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhilesmartphp%2Feloquent-assets/lists"}