$handlerStack = new HandlerStack(Utils::chooseHandler());
$handlerStack->push(new PropagateInitialEventLaravelGuzzleMiddleware());
public function bootstrap()
{
parent::bootstrap();
(new SetInitialEventArtisanMiddleware())->handle();
}
use Ensi\LaravelInitialEventPropagation\Job;
// Extend the job from package
class TestJob extends Job implements ShouldQueue
{
public function __construct(protected Customer $customer)
{
// Do not forget to call parent constuctor
parent::__construct();
}
public function handle()
{
// InitialEvent is automatically persisted to InitialEventHolder via job middleware in parent class,
// You do not need to persist it manually
}
}