PHPackages                             antwerpes/laravel-event-store - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. antwerpes/laravel-event-store

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antwerpes/laravel-event-store
=============================

Store for tracking events in laravel applications

1.2.0(1y ago)2205[3 PRs](https://github.com/antwerpes/laravel-event-store/pulls)MITPHPPHP ^8.1CI passing

Since Dec 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/antwerpes/laravel-event-store)[ Packagist](https://packagist.org/packages/antwerpes/laravel-event-store)[ Docs](https://github.com/antwerpes/laravel-event-store)[ RSS](/packages/antwerpes-laravel-event-store/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Laravel Event Store
===================

[](#laravel-event-store)

[![Latest Version on Packagist](https://camo.githubusercontent.com/592ac0d8a6fe7b84b24a2a0ef6798efc3cc97ef1b209984787dcd0cf46c255a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e747765727065732f6c61726176656c2d6576656e742d73746f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/antwerpes/laravel-event-store)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/fe230dbe23cbde89f26afbb25c44a0bbb47d2468d5e79bd492139596198c0cb9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616e747765727065732f6c61726176656c2d6576656e742d73746f72652f6c696e742e796d6c3f6272616e63683d6d6173746572)](https://github.com/antwerpes/laravel-event-store/actions?query=workflow%3Alint+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/2c07bdf29e2852fbd03ce80d04dc5c9889efd6f37684d69bd3de4511d53ff0a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e747765727065732f6c61726176656c2d6576656e742d73746f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/antwerpes/laravel-event-store)

Simple store for tracking events (e.g. for Google Tag Manager) in Laravel. Fire events from anywhere in your application and later retrieve them in your frontend.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require antwerpes/laravel-event-store
```

You must also add the middleware to your `web` group, at the end of the stack:

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

You can optionally publish the config file with:

```
php artisan vendor:publish --tag="laravel-event-store-config"
```

This is the contents of the published config file:

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

Usage
-----

[](#usage)

From anywhere in your application, you can fire events like this:

```
use Antwerpes\LaravelEventStore\Facades\EventStore;

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

Events that you don't retrieve during the current request cycle will be flashed to the session and made available to the next request. That way, you can also fire events and retrieve them after a redirect.

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

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

In your frontend, you can dump the events like this:

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

which will output something like this:

```

    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
        'event': 'event-name',
        'foo': 'bar'
    });

```

In case you want to use a different variable name, you can pass it as a parameter:

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

You can also pull the events as an array and use them however you like:

```
EventStore::pullEvents();
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Contributions are welcome! Leave an issue on GitHub, or create a Pull Request.

Credits
-------

[](#credits)

- [Elisha Witte](https://github.com/chiiya)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance46

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~241 days

Total

3

Last Release

400d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34a7cd6c6e8c5fd30b6cd28645c3384f343fc90d10b0df8c80c7ad424e3dba2a?d=identicon)[chiiya](/maintainers/chiiya)

---

Top Contributors

[![chiiya](https://avatars.githubusercontent.com/u/15029301?v=4)](https://github.com/chiiya "chiiya (7 commits)")

---

Tags

laravelGoogle Tag Managerantwerpeslaravel-event-store

### Embed Badge

![Health badge](/badges/antwerpes-laravel-event-store/health.svg)

```
[![Health](https://phpackages.com/badges/antwerpes-laravel-event-store/health.svg)](https://phpackages.com/packages/antwerpes-laravel-event-store)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
