PHPackages                             alazziaz/laravel-dapr-publisher - 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. alazziaz/laravel-dapr-publisher

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

alazziaz/laravel-dapr-publisher
===============================

Publisher helpers for sending Laravel events over Dapr Pub/Sub.

v2.1.1(5mo ago)10MITPHPPHP ^8.2

Since Oct 28Pushed 5mo agoCompare

[ Source](https://github.com/alazzi-az/laravel-dapr-publisher)[ Packagist](https://packagist.org/packages/alazziaz/laravel-dapr-publisher)[ RSS](/packages/alazziaz-laravel-dapr-publisher/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (9)Versions (35)Used By (0)

Dapr Events Publisher
=====================

[](#dapr-events-publisher)

[![Packagist Version](https://camo.githubusercontent.com/6eb431aca5476f0e27b5faef8130c1402af9d211d45c0bfa6f3275d69c6b21f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c617a7a69617a2f6c61726176656c2d646170722d7075626c69736865722e7376673f636f6c6f723d306636616234)](https://packagist.org/packages/alazziaz/laravel-dapr-publisher)[![Total Downloads](https://camo.githubusercontent.com/586286166ea4205e1645953cb8a53fb2bcb9d4f134afbd85da0b4aa09f71fbc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c617a7a69617a2f6c61726176656c2d646170722d7075626c69736865722e737667)](https://packagist.org/packages/alazziaz/laravel-dapr-publisher)

Helper classes and middleware pipeline for publishing Laravel events through the Dapr sidecar.

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

[](#installation)

```
composer require alazziaz/laravel-dapr-publisher
```

> Requires `alazziaz/laravel-dapr-foundation` which provides shared config and topic resolution.

EventPublisher
--------------

[](#eventpublisher)

```
$publisher = app(\AlazziAz\LaravelDaprPublisher\EventPublisher::class);
$publisher->publish(new App\Events\OrderPlaced($id, $amount));
```

Publishing behaviour:

- Resolves the topic via `TopicResolver` (`App\Events\OrderPlaced` → `order.placed`).
- Serializes the event payload (array, JsonSerializable, `ProvidesPayload`, or property map).
- Wraps the payload in a CloudEvent envelope (`serialization.wrap_cloudevent`).
- Sends the result via `DaprClient::publishEvent`.

Middleware pipeline
-------------------

[](#middleware-pipeline)

Configure middleware in `config/dapr.php` under `publisher.middleware`:

- `AddCorrelationId` – propagates/creates a correlation ID and logs it.
- `AddTenantContext` – forwards `X-Tenant-ID` or the authenticated user's tenant identifier.
- `AddTimestamp` – stamps the publish time in RFC3339 format.

You can push additional middleware classes to mutate metadata or payloads before the publish call.

Testing
-------

[](#testing)

Use the fake to assert publishing:

```
$fake = \AlazziAz\LaravelDaprPublisher\Testing\DaprEventFake::register(app());

event(new App\Events\OrderPlaced('123', 9900));

$fake->assertPublished(App\Events\OrderPlaced::class);
```

See `tests/EventPublisherTest.php` for more examples.

PHP compatibility note
----------------------

[](#php-compatibility-note)

Because the official `dapr/php-sdk` only publishes `dev-main` builds and targets PHP 8.4, consuming apps on PHP 8.2/8.3 must either allow dev stability (with `prefer-stable` still true) or lock to an SDK tag that supports their PHP version until upstream ships a stable release.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance69

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~2 days

Recently: every ~10 days

Total

34

Last Release

178d ago

Major Versions

v1.0.1 → v2.0.02025-10-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/750a1566a9f2ed8de9e8da9fee372b4426d7585bfdabdb65a1932a40e409a3e3?d=identicon)[alazzi](/maintainers/alazzi)

---

Top Contributors

[![mohammedazman](https://avatars.githubusercontent.com/u/56982649?v=4)](https://github.com/mohammedazman "mohammedazman (10 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alazziaz-laravel-dapr-publisher/health.svg)

```
[![Health](https://phpackages.com/badges/alazziaz-laravel-dapr-publisher/health.svg)](https://phpackages.com/packages/alazziaz-laravel-dapr-publisher)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/view

The Illuminate View package.

13047.0M2.2k](/packages/illuminate-view)[illuminate/events

The Illuminate Events package.

13557.0M2.1k](/packages/illuminate-events)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)

PHPackages © 2026

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