// The default EventServiceProvider must be registered.
$app->register(App\Providers\EventServiceProvider::class);
...
$app->configure('transactional-events');
$app->register(Merkeleon\Events\EventServiceProvider::class);
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
...
use Merkeleon\Events\Contracts\TransactionalEvent;
class TicketsOrdered implements TransactionalEvent
{
use Dispatchable, InteractsWithSockets, SerializesModels;
...
}
Event::dispatch(new App\Event\TicketsOrdered) // Using Event facade
event(new App\Event\TicketsOrdered) // Using event() helper method
broadcast(new App\Event\TicketsOrdered) // Using broadcast() helper method