Looking to hire Laravel developers? Try LaraJobs

laravel-x402 maintained by sandermuller

Description
Laravel adapter for the x402 payment protocol — pay-per-request HTTP APIs with stablecoins.
Author
Last update
2026/05/18 08:53 (dev-main)
License
Downloads
207

Comments
comments powered by Disqus

laravel-x402

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.