PHP code example of wallsfantasy / service-bus-laravel-package

1. Go to this page and download the library: Download wallsfantasy/service-bus-laravel-package library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wallsfantasy / service-bus-laravel-package example snippets




use \Camuthig\ServiceBus\Package\Test\Fixture\TestEvent;

// Using the facade
\Camuthig\ServiceBus\Package\Facade\EventBus::dispatch(new TestEvent());

// Getting the Prooph interface from the container
app()->make(\Prooph\ServiceBus\EventBus::class)->dispatch(new TestEvent()); 



// As a facade
\Camuthig\ServiceBus\Package\Facade\ServiceBus::eventBus('other_bus');

// Getting the interface from the container
$manager = app()->make(\Camuthig\ServiceBus\Package\Contracts\ServiceBusManager::class);
$manager->eventBus('other_bus');

// Getting the `service_bus` from the container
$manager = app()->make('service_bus');
$manager->eventBus('other_bus');