PHPackages                             alazziaz/laravel-dapr - 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. [API Development](/categories/api)
4. /
5. alazziaz/laravel-dapr

ActiveLibrary[API Development](/categories/api)

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

Laravel-friendly tooling for publishing and consuming events over Dapr Pub/Sub.

v2.1.1(4mo ago)32.7k[1 issues](https://github.com/alazzi-az/laravel-dapr/issues)MITPHPPHP ^8.2CI failing

Since Oct 28Pushed 4mo agoCompare

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

READMEChangelog (10)Dependencies (11)Versions (33)Used By (0)

Laravel Dapr Events
===================

[](#laravel-dapr-events)

[![Packagist Version](https://camo.githubusercontent.com/bc3eb02df213d78c014f8fb470c5e5d13391c98c594f68558aa6cb1b22b8e9b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c617a7a69617a2f6c61726176656c2d646170722e7376673f636f6c6f723d306636616234)](https://packagist.org/packages/alazziaz/laravel-dapr)[![Total Downloads](https://camo.githubusercontent.com/c41282ab0ca48164e5ff3752b97b6e50bccd09c280d76374793f6a195e71116c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c617a7a69617a2f6c61726176656c2d646170722e737667)](https://packagist.org/packages/alazziaz/laravel-dapr)

Laravel-friendly tooling for publishing and consuming framework events over [Dapr Pub/Sub](https://docs.dapr.io/developing-applications/building-blocks/pubsub/), mirroring the developer ergonomics of while swapping RabbitMQ, kafka transport for the Dapr sidecar.

Packages
--------

[](#packages)

- **`alazziaz/laravel-dapr`** – metapackage that installs all components in one go.
- **`alazziaz/laravel-dapr-foundation`** – shared contracts, service provider, config, and documentation. Publishes the `/dapr/subscribe` endpoint and bridges local Laravel events to Dapr.
- **`alazziaz/laravel-dapr-publisher`** – Dapr-backed publisher with middleware pipeline, CloudEvent wrapping, and testing fakes.
- **`alazziaz/laravel-dapr-listener`** – Subscription discovery, HTTP ingress controller, listener middleware, and artisan tooling to scaffold listeners.
- **`alazziaz/laravel-dapr-invoker`** – Registers invocation routes for Dapr service invocation and ships a helper to call other services via `invokeMethod`.

Install the metapackage for the full experience:

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

- **if you face any issues with php version, only add --ignore-platform-reqs flag to the above command this issue related to dapr-php-sdk package.**

Highlights
----------

[](#highlights)

- Automatically expose Laravel events to Dapr via `GET /dapr/subscribe`.
- Publish events with `event(new OrderPlaced(...))` or the explicit publisher service.
- Middleware pipelines on both publisher and listener sides for correlation IDs, tenancy, timestamps, and retries.
- Optional signature verification for ingress requests.
- Tests powered by Pest + Orchestra Testbench with a `DaprEventFake` for publisher assertions.
- Service invocation support: expose Laravel actions to Dapr and call other services via the `dapr_invoke()` helper.
- Example Laravel application under `examples/laravel-app` to demonstrate end-to-end usage.

Refer to [`docs/quickstart.md`](docs/quickstart.md) for setup guidance, Dapr component examples, and workflow details.

### Example applications

[](#example-applications)

Looking for a full end-to-end demo? Check out the companion repo: [mohammedazman/laravel-dapr-events-example](https://github.com/mohammedazman/laravel-dapr-events-example). It contains a pair of Laravel services wired up with these packages and ready to run against a Dapr sidecar.

Service invocation
------------------

[](#service-invocation)

Laravel’s Dapr Invoker allows you to expose invokable endpoints that can be called through Dapr’s service invocation API.

> **Important:**If you are invoking your Laravel service through Dapr (e.g., `/dapr/invoke/{method}`), you **must disable CSRF protection** for this prefix. Add the following to your global middleware configuration:
>
> ```
> $middleware->validateCsrfTokens(except: [
>     'dapr/invoke/*',
> ]);
> ```
>
>
>
> Dapr requests are stateless and do not include CSRF tokens, so CSRF must be excluded.

---

You can invoke any laravel route/method via Dapr service invocation. To do this, create an invokable handler:

Register invokable handlers in your Laravel routes:

```
Route::daprInvoke([
    'orders.create' => \App\Http\Controllers\Orders\CreateViaInvoke::class,
]);

// or mount the default controller and manage handlers via config
Route::daprInvokeController();
```

Call other services via Dapr:

```
$response = dapr_invoke('billing-service', 'health.check');
```

Set `invocation.auto_register` to `true` in `config/dapr-invocation.php` if you want the default `/dapr/invoke/{method}` route to be registered automatically when the service provider boots.

See [`laravel-invoker'](https://github.com/alazzi-az/laravel-dapr-invoker/blob/main/README.md) for more details.

PHP compatibility with `dapr/php-sdk`
-------------------------------------

[](#php-compatibility-with-daprphp-sdk)

The official Dapr PHP SDK only ships development builds right now and its `dev-main` branch targets PHP 8.4. Until upstream tags a stable release, you have two practical options when installing these packages:

1. Allow dev dependencies for the SDK in your consuming application:

    ```
    {
      "minimum-stability": "dev",
      "prefer-stable": true
    }
    ```

    or require the SDK explicitly with a dev constraint:

    ```
    composer require dapr/php-sdk:dev-main --prefer-stable --ignore-platform-reqs
    ```

    or add to your `composer.json`:

    ```
    {
      "require": {
        "dapr/php-sdk": "dev-main"
      },
      "prefer-stable": true
    }
    ```
2. Pin to a released SDK version (for example `^1.2`) if you can work with the APIs available there.

This requirement exists because the upstream Dapr SDK has not yet published a stable release that supports PHP 8.2/8.3.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance70

Regular maintenance activity

Popularity25

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Total

32

Last Release

125d ago

Major Versions

v1.0.1 → v2.0.32025-11-09

### 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 (40 commits)")

---

Tags

laravelinvokereventslistenerpubsubpublisherdapr

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)

PHPackages © 2026

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