Effortless Laravel Performance Testing with VoltTest PHP SDK
When your Laravel app hits real traffic, will it fly… or will it fall over?
Most load-testing tools make you jump through hoops — learn a new scripting language, spin up external services, or fight with configs that feel like they belong to another ecosystem.
That’s why I built the Laravel Performance Testing package:
a native, PHP-first way to run load and stress tests right inside your Laravel project — powered by the VoltTest PHP SDK.
You write your tests in plain PHP, keep them version-controlled with your codebase, and run them with a single Artisan command. No context-switching. No external scripts. Just Laravel, PHP, and the performance insights you need before your users find the bottlenecks.
The VoltTest Laravel package lets you write and run load tests inside your Laravel project with Artisan commands, route-based test generation, and CSV data sources — no external tools or languages needed.

Why Was This Package Created?
About a month ago, I released this package to make performance testing in Laravel:
- Easier – no external scripts or frameworks to learn.
- Native – tests live inside your Laravel project.
- Flexible – from simple single-URL load tests to complex multi-step scenarios.
What Features Does the Package Include?
- Laravel-friendly integration – Works seamlessly with routes, middleware, and config.
- Artisan commands – Generate and run tests directly from the CLI.
- Automatic route discovery – Quickly build test scenarios from your existing routes.
- Variable extraction – Reuse cookies, headers, JSON fields, and HTML values between steps.
- Data-driven testing – Feed test data from CSV files for realistic simulations.
- Detailed metrics – Success rate, RPS, average latency, P95 latency, and more.
- Report storage – Save test results for later analysis.
Installation
Install via Composer:
composer require volt-test/laravel-performance-testing
Publish the configuration file:
php artisan vendor:publish --tag=volttest-config
This creates config/volttest.php where you can tweak settings like default virtual users, duration, and report paths.
Quick Start
You can run a quick performance test without writing any code:
php artisan volttest:run https://example.com/api/login --users=100 --method=POST --body='{"email":"test@example.com","password":"secret"}'
Or, you can create a reusable test class:
php artisan volttest:make ExampleTest
This generates app/VoltTests/ExampleTest.php:
namespace App\VoltTests;
use VoltTest\Laravel\Contracts\VoltTestCase;
use VoltTest\Laravel\VoltTestManager;
class ExampleTest implements VoltTestCase
{
public function define(VoltTestManager $manager): void
{
$manager->scenario('ExampleTest')
->step('Visit Home Page')
->get('https://example.com')
->validateStatus('success', 200);
}
}
Run it with:
php artisan volttest:run ExampleTest --users=50 --duration=30
Route-Based Test Generation
Skip manual coding by letting the package generate tests from your Laravel routes.
# Include all routes
php artisan volttest:make ApiTest --routes
# Filter by pattern
php artisan volttest:make ApiTest --routes --filter="api/*"
# Only GET routes
php artisan volttest:make ApiTest --routes --method=GET
# Only authenticated routes
php artisan volttest:make ApiTest --routes --auth
# Interactive selection
php artisan volttest:make ApiTest --routes --select
Data-Driven Testing
Simulate realistic usage with CSV files:
users.csv
name,email,password
John Doe,user1@example.com,password123
Jane Smith,user2@example.com,password456
Test definition:
$manager->scenario('RegisterTest')
->dataSource('users.csv')
->step('Register User')
->post('/register', [
'name' => '${name}',
'email' => '${email}',
'password' => '${password}',
]);
Extract and Reuse Values
You can capture values from responses and reuse them in later steps.
CSRF token from HTML
$scenario->step('Get Login Page')
->get('/login')
->extractCsrfToken('csrf_token');
$scenario->step('Submit Login')
->post('/login', [
'_token' => '${csrf_token}',
'email' => 'user@example.com',
'password' => 'secret',
]);
JSON field
$scenario->step('Get User')
->get('/api/user')
->extractJson('user_id', 'data.id');
Header
$scenario->step('Get Token')
->get('/auth')
->extractHeader('Authorization', 'Bearer ${token}');
Analyzing Results
After running a test, you’ll see metrics such as:
- Success rate
- Requests per second (RPS)
- Average & P95 latency
- Duration
- Errors
If save_reports is enabled, you’ll find detailed reports in:
storage/volttest/reports
Conclusion
With Laravel Performance Testing powered by the VoltTest PHP SDK, you can:
- Keep performance tests right inside your Laravel project.
- Run them with one simple Artisan command.
- Get detailed, actionable performance metrics before your users ever notice a slowdown.
No separate scripting language. No complex setup. Just Laravel, PHP, and the truth about your app’s performance.
For a comprehensive comparison of PHP load testing tools and when to use each, see our PHP Load Testing guide. If you need to push past expected traffic to find breaking points, check out the PHP Stress Testing Tool guide.
Docs: Laravel Performance Testing on GitHub
VoltTest PHP SDK: docs.volt-test.com
Integrate VoltTest into your CI pipeline to catch performance regressions before they hit production. See Load Testing Laravel with PHPUnit for a step-by-step guide.
VoltTest Cloud is now in closed beta — run distributed load tests at scale without managing infrastructure. Learn more about Cloud access →
Join Early Access
Sign up to join the waitlist. We review and approve access in waves.
