{"id":51045342,"url":"https://github.com/whilesmartphp/eloquent-customers","last_synced_at":"2026-06-22T13:02:36.756Z","repository":{"id":357452313,"uuid":"1203549228","full_name":"whilesmartphp/eloquent-customers","owner":"whilesmartphp","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-10T13:13:59.000Z","size":9,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2026-06-10T13:16:46.928Z","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":null,"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":null,"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-04-07T06:22:13.000Z","updated_at":"2026-05-12T20:02:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/whilesmartphp/eloquent-customers","commit_stats":null,"previous_names":["whilesmartphp/eloquent-customers"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/whilesmartphp/eloquent-customers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-customers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-customers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-customers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-customers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whilesmartphp","download_url":"https://codeload.github.com/whilesmartphp/eloquent-customers/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whilesmartphp%2Feloquent-customers/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:36.087Z","updated_at":"2026-06-22T13:02:36.749Z","avatar_url":"https://github.com/whilesmartphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# whilesmart/eloquent-customers\n\nPolymorphic customer management for Laravel applications.\n\n## Install\n\n```bash\ncomposer require whilesmart/eloquent-customers\nphp artisan migrate\n```\n\n## Use\n\nAdd `HasCustomers` to any model that should own customers (Workspace, Organization, User, etc.):\n\n```php\nuse Whilesmart\\Customers\\Traits\\HasCustomers;\n\nclass Workspace extends Model\n{\n    use HasCustomers;\n}\n```\n\nThe trait gives you a `morphMany` relation:\n\n```php\n$workspace-\u003ecustomers()-\u003ecreate([\n    'name' =\u003e 'Acme Corp',\n    'email' =\u003e 'billing@acme.com',\n    'currency' =\u003e 'USD',\n]);\n```\n\n## Endpoints\n\n`GET    /api/customers` — list (filter by `owner_type` + `owner_id`, search via `?q=`)\n`POST   /api/customers` — create\n`GET    /api/customers/{id}` — show\n`PUT    /api/customers/{id}` — update\n`DELETE /api/customers/{id}` — soft delete\n\n## Schema\n\n`customers` table:\n\n| column | type |\n|---|---|\n| id | bigint |\n| owner_type / owner_id | morphs |\n| name | string |\n| type | individual / organization (default individual) |\n| email, phone, tax_id, website | nullable strings |\n| billing_address, shipping_address, notes | text |\n| currency | char(3) |\n| is_active | boolean |\n| metadata | json |\n| timestamps + soft deletes | |\n\n## Config\n\nPublish with `php artisan vendor:publish --tag=customers-config`. Override `register_routes`, `route_prefix`, `route_middleware`, and `table` via env or the published config file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhilesmartphp%2Feloquent-customers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhilesmartphp%2Feloquent-customers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhilesmartphp%2Feloquent-customers/lists"}