Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #32 from madewithlove/improve-laravel-support
Browse files Browse the repository at this point in the history
Improve Laravel support
  • Loading branch information
Xavier Barbosa authored Mar 11, 2020
2 parents 8ff1fb5 + 84bb787 commit 57af220
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ php artisan vendor:publish --provider="Madewithlove\LaravelCqrsEs\ServiceProvide

## Documentation

- [Sagas](./docs/generators.md)
- [Generators](./docs/generators.md)
- [Sagas](./docs/sagas.md)

## Credits and thanks

This package borrows components from [nWidart/Laravel-broadway](https://github.com/nWidart/Laravel-broadway) and includes a laravel ServiceProvider for [matthiasnoback/broadway-serialization](https://github.com/matthiasnoback/broadway-serialization).
This package borrows components from [nWidart/Laravel-broadway](https://github.com/nWidart/Laravel-broadway) and includes a Laravel ServiceProvider for [matthiasnoback/broadway-serialization](https://github.com/matthiasnoback/broadway-serialization).

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
16 changes: 11 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
"php": ">=7",
"doctrine/dbal": "~2.5",
"broadway/broadway": "~1.0.0",
"illuminate/console": "~5.4",
"illuminate/database": "~5.4",
"illuminate/events": "~5.4",
"illuminate/support": "~5.4",
"illuminate/console": "^5.4|^5.5|^6",
"illuminate/database": "^5.4|^5.5|^6",
"illuminate/events": "^5.4|^5.5|^6",
"illuminate/support": "^5.4|^5.5|^6",
"matthiasnoback/broadway-serialization": "~2.0",
"mattketmo/uuid-2x-bridge": "^1.0",
"broadway/broadway-saga": "^0.2.0",
"broadway/event-store-dbal": "^0.1.0",
"broadway/read-model-elasticsearch": "^0.2.0"
Expand All @@ -53,6 +52,13 @@
"tests/Stubs/BookWasReturned.php"
]
},
"extra": {
"laravel": {
"providers": [
"Madewithlove\\LaravelCqrsEs\\ServiceProvider"
]
}
},
"suggest": {
"madewithlove/tactician-laravel": "Laravel wrapper for a configurable command bus"
},
Expand Down
5 changes: 2 additions & 3 deletions src/EventStore/Console/Replay.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Madewithlove\LaravelCqrsEs\EventStore\Console;

use Illuminate\Console\Command;
use Illuminate\Contracts\Container\Container;
use Illuminate\Events\Dispatcher;
use Madewithlove\LaravelCqrsEs\EventStore\Events\PostEventStoreReplay;
use Madewithlove\LaravelCqrsEs\EventStore\Events\PreEventStoreReplay;
Expand Down Expand Up @@ -60,10 +59,10 @@ public function handle()
$params['types'] = explode(',', $types);
}

$this->dispatcher->fire(new PreEventStoreReplay());
$this->dispatcher->dispatch(new PreEventStoreReplay());

$this->replayService->replay($params);

$this->dispatcher->fire(new PostEventStoreReplay());
$this->dispatcher->dispatch(new PostEventStoreReplay());
}
}
3 changes: 2 additions & 1 deletion src/EventStore/EventStoreManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Broadway\Serializer\Serializer;
use Broadway\UuidGenerator\Converter\BinaryUuidConverter;
use Doctrine\DBAL\DriverManager;
use Illuminate\Support\Arr;
use Illuminate\Support\Manager;

class EventStoreManager extends Manager
Expand Down Expand Up @@ -42,7 +43,7 @@ protected function createDbalDriver()
$connection,
$this->app->make(Serializer::class),
$this->app->make(Serializer::class),
array_get($config, 'table', 'event_store'),
Arr::get($config, 'table', 'event_store'),
false,
new BinaryUuidConverter()
);
Expand Down
2 changes: 1 addition & 1 deletion src/Saga/SagaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function createMongodbDriver()
$databaseConfig = $this->app['config']->get('database.connections.mongodb');
$broadwayConfig = $this->app['config']->get('broadway.saga.mongodb');

$options = array_get($databaseConfig, 'options', []);
$options = Arr::get($databaseConfig, 'options', []);

$dsn = $this->getDsn($databaseConfig);
$connection = $this->createConnection($dsn, $databaseConfig, $options);
Expand Down

0 comments on commit 57af220

Please sign in to comment.