{"id":13828461,"url":"https://github.com/msgphp/msgphp","last_synced_at":"2025-03-30T08:23:05.140Z","repository":{"id":208860021,"uuid":"107008502","full_name":"msgphp/msgphp","owner":"msgphp","description":"Reusable domain layers. Shipped with industry standard infrastructure.","archived":false,"fork":false,"pushed_at":"2023-11-23T16:23:42.000Z","size":2439,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T10:25:10.940Z","etag":null,"topics":["api-platform","cli","cqrs","doctrine","domain-driven-design","domain-model","eav","entity-attribute-value","event-sourcing","message-driven","php","php7","rich-domain","security","symfony","symfony-bundle","twig","user-management","uuid"],"latest_commit_sha":null,"homepage":"https://msgphp.github.io/","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/msgphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-15T12:05:36.000Z","updated_at":"2024-12-03T22:18:35.000Z","dependencies_parsed_at":"2023-11-23T17:30:09.542Z","dependency_job_id":"f4388b86-eb87-4b07-a3af-76cdb20267ef","html_url":"https://github.com/msgphp/msgphp","commit_stats":null,"previous_names":["msgphp/msgphp"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgphp%2Fmsgphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgphp%2Fmsgphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgphp%2Fmsgphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgphp%2Fmsgphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msgphp","download_url":"https://codeload.github.com/msgphp/msgphp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246292048,"owners_count":20753994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api-platform","cli","cqrs","doctrine","domain-driven-design","domain-model","eav","entity-attribute-value","event-sourcing","message-driven","php","php7","rich-domain","security","symfony","symfony-bundle","twig","user-management","uuid"],"created_at":"2024-08-04T09:02:47.989Z","updated_at":"2025-03-30T08:23:05.117Z","avatar_url":"https://github.com/msgphp.png","language":"PHP","readme":"# NOT ACTIVELY SUPPORTED ANY MORE!!\n\nmsgphp/* repositories are not actively developed/supported anymore.\n\n**Use in production on your own risks.**\n\nIf you want to do some hotfixes - please do PR directly in target repository instead of this monorepository.\n\n# Message Driven PHP\n\n[![Build Status][master:travis:img]][master:travis]\n[![Code Coverage][master:codecov:img]][master:codecov]\n\nMsgPHP is a project that aims to provide reusable domain layers for your application. It has a low development time\noverhead and avoids being overly opinionated.\n\nIt follows [Semantic Versioning], yet during development phase a package can be marked `@experimental` to indicate\n\"[BC] breaks\" could be introduced.\n\n## Domain Layers\n\n\u003e The domain layer is a collection of entity objects and related business logic that is designed to represent the\nenterprise business model. The major scope of this layer is to create a standardized and federated set of objects, that\ncould be potentially reused within different projects. ([source](https://www.javacodegeeks.com/2013/05/multilayered-architecture-2-the-domain-layer.html))\n\nCurrently supported domain layers are:\n\n- [`Eav`][domain:eav]\n- [`User`][domain:user]\n  - [`UserEav`][domain:user-eav]\n\nOn the roadmap are:\n\n- `Organization`\n- `File`\n- `Taxonomy`\n- ...\n\n## Design-Time Considerations\n\n- The base domain package (`msgphp/domain`) integrates with **YOUR** domain layer (it's dependency free by design)\n- You inherit from the default domain layers, if used\n- The first-class supported ORM is [Doctrine ORM]\n- The first-class supported message bus is [Symfony Messenger]\n\n## Message Based\n\nEach domain layer provides a set of messages to consume it. Typically the messages are categorized into command-, event-\nand query-messages.\n\nThe main advantage is we can intuitively create an independent flow of business logic. It provides consistency in\nhandling our business logic by dispatching the same message in e.g. web as well as CLI.\n\n```php\n$anyMessageBus-\u003edispatch(new CreateSomething(['field' =\u003e 'value']));\n```\n\nA command-message is dispatched and picked up by its handler to do the work. This handler on itself dispatches a new\nevent-message (e.g. `SomethingCreated`) to notify the work is done.\n\nA custom handler can subscribe to the `SomethingCreated` event to further finalize the business requirements (e.g.\ndispatch another commmand-message).\n\n```php\nclass MakeSomethingWork\n{\n    private $bus;\n\n    public function __construct(YourFavoriteBus $bus)\n    {\n        $this-\u003ebus = $bus;\n    }\n\n    public function __invoke(SomethingCreated $event)\n    {\n        // do work, or better delegate work:\n        $this-\u003ebus-\u003edispatch(new LetSomethingWork($event-\u003esomething));\n    }\n}\n```\n\n# Documentation\n\n- Read the [main documentation](https://msgphp.github.io/docs/)\n- Try the Symfony [demo application](https://github.com/msgphp/symfony-demo-app)\n- Get support on [Symfony's Slack `#msgphp` channel](https://symfony.com/slack-invite) or [raise an issue](https://github.com/msgphp/msgphp/issues/new)\n\n# Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md)\n\n[master:travis]: https://travis-ci.com/msgphp/msgphp\n[master:travis:img]: https://img.shields.io/travis/com/msgphp/msgphp/master.svg?style=flat-square\n[master:codecov]: https://codecov.io/gh/msgphp/msgphp\n[master:codecov:img]: https://img.shields.io/codecov/c/github/msgphp/msgphp/master.svg?style=flat-square\n[domain:eav]: https://github.com/msgphp/eav\n[domain:user]: https://github.com/msgphp/user\n[domain:user-eav]: https://github.com/msgphp/user-eav\n[Semantic Versioning]: https://semver.org/\n[BC]: https://en.wikipedia.org/wiki/Backward_compatibility\n[Doctrine ORM]: https://www.doctrine-project.org/projects/orm.html\n[Symfony Messenger]: https://symfony.com/doc/current/components/messenger.html\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgphp%2Fmsgphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsgphp%2Fmsgphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgphp%2Fmsgphp/lists"}