PHP code example of antwerpes / laravel-event-store

1. Go to this page and download the library: Download antwerpes/laravel-event-store 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/ */

    

antwerpes / laravel-event-store example snippets


protected $middlewareGroups = [
    'web' => [
        ...
        \Antwerpes\LaravelEventStore\Middleware\FlashEventStore::class,
    ],
];

return [
    'session_key' => '_eventStore',
];

use Antwerpes\LaravelEventStore\Facades\EventStore;

EventStore::push('event-name');
// Or with additional data
EventStore::push('event-name', ['foo' => 'bar']);

// This will work
EventStore::push('event-name');
return view('some-view');

// This will also work
EventStore::push('event-name');
return redirect()->route('some-route');

{!! EventStore::dumpForGTM() !!}

{!! EventStore::dumpForGTM('myDataLayer') !!}

EventStore::pullEvents();
bash
php artisan vendor:publish --tag="laravel-event-store-config"