a2a-laravel maintained by praveendias1180
Description
Laravel bridge for the A2A PHP SDK: Route::a2a(), queued execution with live SSE streaming, Redis Streams or database event log, owner-scoped storage.
Author
Last update
2026/09/26 07:32
(dev-main)
License
Downloads
10
Tags
A2A for Laravel
Laravel bridge for the A2A PHP SDK: serve and call A2A (Agent2Agent) agents from Laravel 12 and 13 (Laravel 11 is allowed but untested; Composer blocks its releases for security advisories).
Read-only split. Development happens in
praveendias1180/a2a-phpunderpackages/laravel. Open issues and PRs there.
📖 Guide: https://praveendias1180.github.io/a2a-php/guides/laravel/
composer require praveendias1180/a2a-laravel
php artisan vendor:publish --tag=a2a-migrations && php artisan migrate
php artisan a2a:make-executor Hello
// routes/api.php
Route::a2a('/a2a', agentCard: HelloAgentCard::class, executor: HelloExecutor::class)
->middleware('auth:sanctum');
- One route macro mounts the Agent Card (
/.well-known/agent-card.json), JSON-RPC and HTTP+JSON, and fills the card's interface URLs in from your routes.route:cachesafe. - Queued execution (
A2A_RUNNER=queued): executors run on your queue workers (Horizon, supervisor), and the web request streams their events live over SSE. Tasks outlive the request that started them; cancel reaches the worker. - Event log on Redis Streams or your database. Tasks, events and encrypted push-notification configs are stored on your DB connection, scoped to the authenticated user.
- Client:
A2A::client('https://agent.example.com')->sendMessage(...). - Artisan:
a2a:make-executor,a2a:card,a2a:prune,a2a:tck.
Proven with the official A2A TCK: a Laravel app on PHP-FPM + nginx with the queued runner passes the MUST level (conformance).
Apache-2.0.