sandermuller / laravel-x402
Laravel adapter for the x402 payment protocol — pay-per-request HTTP APIs with stablecoins.
dev-main / 0.1.x-dev
2026-05-06 18:27 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.9
- illuminate/console: ^11.0|^12.0
- illuminate/contracts: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- nyholm/psr7: ^1.8
- sandermuller/php-x402: ^0.1@dev
- symfony/psr-http-message-bridge: ^7.0|^8.0
Requires (Dev)
- dg/bypass-finals: ^1.9
- driftingly/rector-laravel: ^2.3
- larastan/larastan: ^3.0
- laravel/pint: ^1.29
- mockery/mockery: ^1.6
- mrpunyapal/rector-pest: ^0.2
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- rector/rector: ^2.0
- rector/type-perfect: ^2.1
- sandermuller/package-boost: ^0.10
- spatie/ray: ^1.48
- spaze/phpstan-disallowed-calls: ^4.10
- symplify/phpstan-extensions: ^12.0
- tomasvotruba/cognitive-complexity: ^1.1
- tomasvotruba/type-coverage: ^2.1
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.