PHPackages                             volt-test/laravel-performance-testing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. volt-test/laravel-performance-testing

ActiveLibrary[Testing &amp; Quality](/categories/testing)

volt-test/laravel-performance-testing
=====================================

A Laravel package for performance testing with VoltTest

v1.2.0(5mo ago)714.9k↓15.5%3MITPHPPHP ^8.2CI passing

Since Jun 23Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/volt-test/laravel-performance-testing)[ Packagist](https://packagist.org/packages/volt-test/laravel-performance-testing)[ RSS](/packages/volt-test-laravel-performance-testing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (7)Versions (14)Used By (0)

Laravel Performance Testing
===========================

[](#laravel-performance-testing)

A Laravel package for performance testing with the VoltTest PHP SDK. Easily create and run load tests for your Laravel applications with built-in route discovery, CSRF handling, and comprehensive reporting.

This package is built on top of the **[VoltTest PHP SDK](https://php.volt-test.com/)** and provides a seamless Laravel integration layer with additional Laravel-specific features like automatic route discovery, CSRF token handling, and Artisan commands.

For more information about the core VoltTest functionality, visit **[php.volt-test.com](https://php.volt-test.com/)**.

[![Latest Version on Packagist](https://camo.githubusercontent.com/2119f7e73e445f87789a1c148daad905629b33c5d4a89800e1e6105f1f33718b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766f6c742d746573742f6c61726176656c2d706572666f726d616e63652d74657374696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/volt-test/laravel-performance-testing) [![Total Downloads](https://camo.githubusercontent.com/82e503714df7d96b1512e20317a4cb06803a3ee18d004caafa987794f5c849ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766f6c742d746573742f6c61726176656c2d706572666f726d616e63652d74657374696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/volt-test/laravel-performance-testing) [![GitHub Tests Action Status](https://camo.githubusercontent.com/a3464961b30ccdcc88439c7df13c64390fdaf9789ef4516e3736fcb6524c0204/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766f6c742d746573742f6c61726176656c2d706572666f726d616e63652d74657374696e672f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/volt-test/laravel-performance-testing/actions)

Table of Contents
-----------------

[](#table-of-contents)

- [About Laravel Performance Testing VoltTest](#about-laravel-performance-testing-volttest)
- [Requirements](#requirements)
- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Quick Start](#quick-start)
- [Creating Tests](#creating-tests)
- [API Testing](#api-testing)
- [Available Methods](#available-methods)
- [Running Tests](#running-tests)
- [Reports](#reports)
- [CSV Data Sources](#csv-data-sources)
- [PHPUnit Integration](#phpunit-integration)
- [Advanced Configuration](#advanced-configuration)
- [Testing Tips](#testing-tips)
- [Troubleshooting](#troubleshooting)
- [Learn More](#learn-more)

About Laravel Performance Testing VoltTest
------------------------------------------

[](#about-laravel-performance-testing-volttest)

This Laravel package extends the **[VoltTest PHP SDK](https://php.volt-test.com/)** with Laravel-specific functionality. While the core VoltTest PHP SDK provides the foundation for performance testing, this package adds:

- **Laravel Integration** - Service provider, facades, and configuration
- **Artisan Commands** - CLI commands for test creation and execution
- **Route Discovery** - Automatic Laravel route detection and test generation
- **Laravel Scenarios** - Enhanced scenario class with Laravel-specific methods

For comprehensive documentation about VoltTest core features, load testing concepts, and advanced configuration options, please visit **[php.volt-test.com](https://php.volt-test.com/)**.

Requirements
------------

[](#requirements)

- PHP 8.2+
- VoltTest PHP SDK 1.1.0+

Features
--------

[](#features)

- **Easy Laravel Integration** - Seamlessly integrates with Laravel applications
- **Automatic Route Discovery** - Discover and test your application routes automatically
- **Comprehensive Reporting** - Detailed performance reports with metrics
- **URL Load Testing** - Direct URL testing without creating test classes
- **Artisan Commands** - Convenient CLI commands for test creation and execution
- **Configurable** - Flexible configuration options for different environments
- **PHPUnit Integration** - Run performance tests within your PHPUnit test suite with automated server management and assertions
- **CSV Data Sources** - Load dynamic test data from CSV files for realistic performance testing

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require volt-test/laravel-performance-testing --dev
```

The package will automatically register its service provider.

Publish the configuration file:

```
php artisan vendor:publish --tag=volttest-config
```

Configuration
-------------

[](#configuration)

The configuration file `config/volttest.php` contains all the settings for your performance tests:

```
return [
    // Test Configuration
    'name' => env('VOLTTEST_NAME', 'Laravel Application Test'),
    'description' => env('VOLTTEST_DESCRIPTION', 'Performance test for Laravel application'),

    // Load Configuration
    'virtual_users' => env('VOLTTEST_VIRTUAL_USERS', 10),
    'duration' => env('VOLTTEST_DURATION'), // e.g., '1m', '30s', '2h'
    'ramp_up' => env('VOLTTEST_RAMP_UP', null),

    // Debug Configuration
    'http_debug' => env('VOLTTEST_HTTP_DEBUG', false),

    // Test Paths
    'test_paths' => app_path('VoltTests'),

    // Reports
    'reports_path' => storage_path('volttest/reports'),
    'save_reports' => env('VOLTTEST_SAVE_REPORTS', true),

    // Base URL
    'use_base_url' => env('VOLTTEST_USE_BASE_URL', true),
    'base_url' => env('VOLTTEST_BASE_URL', 'http://localhost:8000'),

    // CSV Data Source Configuration
    'csv_data' => [
        'path' => storage_path('volttest/data'), // Default CSV location
        'validate_files' => true,                // Check file exists before run
        'default_distribution' => 'unique',      // Default distribution mode
        'default_headers' => true,               // Default header setting
    ],
];
```

Quick Start
-----------

[](#quick-start)

### 1. Create Your First Test

[](#1-create-your-first-test)

Generate a new performance test with route discovery:

```
php artisan volttest:make UserTest --routes --select
```

This creates a test class at `app/VoltTests/UserTest.php`:

```
