sandermuller/laravel-x402

Laravel adapter for the x402 payment protocol — pay-per-request HTTP APIs with stablecoins.

Maintainers

Package info

github.com/SanderMuller/laravel-x402

Homepage

pkg:composer/sandermuller/laravel-x402

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

This package is auto-updated.

Last update: 2026-05-07 15:47:39 UTC


README

Laravel adapter for the x402 payment protocol. Gate routes behind HTTP 402 stablecoin payments, or pay outbound API calls automatically via the Http facade.

Status: scaffolding. Not yet usable.

Built on top of sandermuller/php-x402 (framework-agnostic core).

Install

composer require sandermuller/laravel-x402
php artisan vendor:publish --tag=x402-config

Server side — gate a route

Route::get('/premium', PremiumController::class)
    ->middleware('x402:0.01,USDC,base');

Client side — pay outbound calls

$response = Http::withX402()->get('https://api.example.com/data');

Wallet key resolved from config/x402.php (default: X402_PRIVATE_KEY env).

MCP support

For laravel/mcp integration, install sandermuller/laravel-x402-mcp.

License

MIT.