HttpClient, Route::fallback(), and Http::fake()). It can be deployed as a Dockerized service, a Laravel Artisan command, or integrated via service providers, making it a first-class citizen in Laravel’s architecture.phpunit or Pest tests with deterministic mocks.UserService mocking a PaymentService).require-dev installation with guzzlehttp/guzzle (already used in Laravel for HTTP clients)._generated/config/codeception.php) for zero-config testing.spatie/fork or nunomaduro/collision for schema compliance.phiremock-server and phiremock-client may cause confusion. The bundle’s role is now unclear—does it add value, or should teams use the standalone repos directly?react/http (v0.7) and symfony/cache (v4) are outdated. Laravel 10+ may introduce breaking changes (e.g., PSR-15 middleware, Symfony 6+).Http::fake()).reset() method in Codeception).v1.x to v2.x (or standalone repos)? Can the bundle be deprecated in favor of direct repo usage?VerifyCsrfToken) in mocked requests?HttpClient without manual proxy configuration?phpunit.xml or Pest configurations?--parallel) without state collisions?Http::fake() for simple cases, or Pest’s HTTP testing for a more modern approach?Http::fake() + custom logic?PhiremockServiceProvider) to manage lifecycle (start/stop server, load JSON configs).phiremock:serve to spin up the server locally (php artisan phiremock:serve --port=8080)..env variables to toggle Phiremock (e.g., PHIREMOCK_ENABLED=true).Http::fake() extension to delegate to Phiremock.phiremock-codeception-extension with Laravel’s Codeception adapter.mcustiel/phiremock image or a custom Dockerfile with Laravel.AuthService) to mock external APIs (e.g., OAuth providers).Http::get('https://api.example.com')) with Phiremock-configured clients.// Before
$response = Http::get('https://api.example.com/users');
// After (using Phiremock)
$response = Http::withOptions(['base_uri' => 'http://phiremock:8080'])
->get('/users');
services:
phiremock:
image: mcustiel/phiremock-server
ports:
- "8080:8080"
volumes:
- ./tests/mocks:/etc/phiremock
tests/mocks/*.json via phiremock-client in phpunit.xml:
<php>
<env name="PHIREMOCK_CONFIG" value="/etc/phiremock"/>
</php>
Http::fake() for simple cases (e.g., unit tests).| Laravel Feature | Phiremock Support | Workaround |
|---|---|---|
HTTP Client (Http::) |
✅ (via proxy or direct REST API) | Configure base_uri to Phiremock’s endpoint. |
| Middleware (e.g., Auth) | ❌ (no middleware simulation) | Mock responses manually or use Http::fake(). |
| Queues/Jobs | ❌ (no async support) | Test jobs with fake() or use real queues. |
| API Resources | ✅ (via regex/JSON matching) | Define expectations for /api/users. |
| GraphQL | ❌ (HTTP-only) | Use Laravel’s fake() or a GraphQL-specific tool. |
| WebSockets | ❌ | Mock with Laravel’s Broadcast::fake(). |
composer.json under require-dev.phiremock:serve to mock APIs locally (e.g., Stripe, Twilio).tests/mocks/.How can I help you explore Laravel packages today?