<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wallsfantasy / event-store-laravel-package example snippets
use Camuthig\EventStore\Package\EventStoreManager;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\Pdo\MySqlEventStore;
class MyController
{
public function __construct(EventStore $eventStore, MySqlEventStore $mySqlEventStore, EventStoreManager $eventStoreManager)
{
// The EventStore interface will be bound to the "default" store
$eventStore->fetchCategoryNames(null);
// Each event store is also bound to the class it is an instance of
$mySqlEventStore->fetchCategoryNames(null);
// The EventStoreManager is also bound into the application
// The default event store can be retrieved from the EventStoreManager
$eventStoreManager->store()->fetchCategoryNames(null);
// Or you can fetch any store by name
$eventStoreManager->store('postgres')->fetchCategoryNames(null);
// Or you can work wih the manager by facade
\Camuthig\EventStore\Package\Facade\EventStore::store()->fetchCategoryNames(null);
}
}
[
App\EventStore\Plugins\MyPlugin::class,
]
[
App\EventStore\Enrichers\MyEnricher::class,
]
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.