kikwik/debounce-bundle
A Symfony bundle that adds debounce support to your applications, delaying repeated actions like form submissions, search requests, and event handlers until input settles. Simple to install and configure, it cuts redundant work and improves responsiveness.
composer require --dev vendor/package
php artisan vendor:publish --tag=package-config
php artisan fake-server:start
Then point your application’s external service base URL at the fake server in .env.local:
EXTERNAL_API_BASE_URL=http://127.0.0.1:8081
use Vendor\Package\Testing\InteractsWithFakeServer;
class ExampleTest extends TestCase
{
use InteractsWithFakeServer;
public function test_it_calls_the_external_service(): void
{
$this->fakeServer()->respond('/orders', ['id' => 123]);
$this->post('/orders')->assertOk();
$this->fakeServer()->assertRequested('/orders', 'POST');
}
}
Http::fake() is still lighter. Use the fake server when you need real HTTP behaviour: middleware, retries, timeouts, streaming, or SDKs that do not use Laravel’s HTTP client.setUp() and stops it in tearDown(). If the server starts once per process, reset its state between tests:
protected function setUp(): void
{
parent::setUp();
$this->fakeServer()->reset();
}
tests/Fixtures/FakeServer/ and register them in a service provider or test helper. This keeps test bodies focused on behaviour rather than payloads..env.local. Avoid hard-coding the fake server URL in application code.php artisan test --parallel, configure the fake server to bind to an ephemeral port and expose the chosen URL to the test process. A fixed port will collide across parallel workers.local and testing environments. Do not register fake-server routes or service providers in production.8080 is free.setUp() or tearDown(), and stop the server even when a test fails..env while using php artisan config:cache, remember to clear and rebuild the config cache. In tests, set the base URL through config() or the test environment rather than relying on cached values.How can I help you explore Laravel packages today?