{"id":19055997,"url":"https://github.com/open-solid/domain","last_synced_at":"2026-01-26T08:35:52.590Z","repository":{"id":237144964,"uuid":"793892779","full_name":"open-solid/domain","owner":"open-solid","description":"Business domain building blocks","archived":false,"fork":false,"pushed_at":"2024-11-27T13:35:02.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-12T22:20:31.385Z","etag":null,"topics":["ddd","domain-events","event-sourcing"],"latest_commit_sha":null,"homepage":"","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/open-solid.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-04-30T04:21:37.000Z","updated_at":"2025-10-03T13:11:19.000Z","dependencies_parsed_at":"2024-04-30T05:44:49.554Z","dependency_job_id":"a7a84ae5-34bb-4334-8de8-ce4a68558060","html_url":"https://github.com/open-solid/domain","commit_stats":null,"previous_names":["open-solid/domain-event","open-solid/domain"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/open-solid/domain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fdomain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fdomain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fdomain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fdomain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-solid","download_url":"https://codeload.github.com/open-solid/domain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fdomain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28770937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T07:45:00.504Z","status":"ssl_error","status_checked_at":"2026-01-26T07:45:00.070Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ddd","domain-events","event-sourcing"],"created_at":"2024-11-08T23:47:42.177Z","updated_at":"2026-01-26T08:35:52.575Z","avatar_url":"https://github.com/open-solid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Domain Building Blocks\n\n## Installation\n\n```bash\ncomposer require open-solid/domain\n```\n\n## Usage\n\n### Domain Events\n\nDomain events are significant occurrences within a software system that\nreflect changes in the state of the domain. These events are used to\ncapture and communicate changes, allowing different parts of the system\nto react accordingly.\n\nFor example, in an e-commerce application, a domain event might be\n\"OrderPlaced\" when a customer completes a purchase. This event can then\ntrigger other actions such as updating inventory, sending a confirmation\nemail, or processing payment. Domain events help to decouple systems,\nmaking them more modular and easier to maintain, as each component can\nindependently respond to changes without being tightly integrated.\n\n```php\n\u003c?php\n\nuse OpenSolid\\Bus\\Handler\\MessageHandlersLocator;\nuse OpenSolid\\Bus\\Middleware\\HandlingMiddleware;\nuse OpenSolid\\Bus\\NativeLazyMessageBus;\nuse OpenSolid\\Bus\\NativeMessageBus;\nuse OpenSolid\\DomainEvent\\Bus\\NativeDomainEventBus;\nuse OpenSolid\\DomainEvent\\DomainEvent;\n\nfinal readonly class UserRegistered extends DomainEvent\n{\n}\n\nfinal readonly class UserRegisteredSubscriber\n{\n    public function __invoke(UserRegistered $event): void\n    {\n        // Handle the event\n    }\n}\n\n$nativeMessageBus = new NativeMessageBus([\n    new HandlingMiddleware(\n        new MessageHandlersLocator([\n            UserRegistered::class =\u003e [new UserRegisteredSubscriber()],\n        ]),\n    ),\n]);\n$bus = new NativeDomainEventBus(new NativeLazyMessageBus($nativeMessageBus));\n\n$bus-\u003epublish(new EntityUpdated('uuid'));\n\n// do something in between ...\n\n$bus-\u003eflush();\n```\n\n## License\n\nThis software is published under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-solid%2Fdomain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-solid%2Fdomain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-solid%2Fdomain/lists"}