Download the PHP package smoothphp/querybus without Composer
On this page you can find all versions of the php package smoothphp/querybus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smoothphp/querybus
More information about smoothphp/querybus
Files in smoothphp/querybus
Package querybus
Short Description A simple bus for queries
License MIT
Homepage https://github.com/smoothphp/querybus
Informations about the package querybus
Query Bus
Install
Via Composer
Usage
The query bus exists to execute queries within the domain of the application. Typically these are read only commands, with write operations being performed using the Command Bus.
The QueryBus is a simple concept, and leaves the majority of the implementation decisions to the developer. A simple implementation is provided for Laravel users.
The query bus exists of 3 components.
- Query
The DTO containing the intent and parameters for the query. - Query Bus
Takes a query object, resolves the query handler, and executes it. - Query Translator
Takes a query, and translates to the query handler class name.
Laravel Users
The Laravel Query bus takes a Query object, and resolves the handler by adding 'Handler' to the class name. This handler class is then resolved by the container and all dependencies are injected.
For example, App\Queries\FindUserById
is resolved to App\Queries\FindUserByIdHandler
, and the handle
method is executed.
You are free to implement query handler resolution however you like, though.
Service Provider
Query
Query Handler
Using
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Simon Bennett
- All Contributors
License
The MIT License (MIT). Please see License File for more information.