PHP code example of ehab-talaat / laravel-tornado

1. Go to this page and download the library: Download ehab-talaat/laravel-tornado library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ehab-talaat / laravel-tornado example snippets


// ✅ Array syntax
$request->validate([
    'name'     => ['' 'class StoreUserRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'name'  => ['
bash
# Stress test an endpoint in 30 seconds
php artisan tornado api/users --method=POST --requests=500 --concurrency=25
bash
php artisan tornado {url} [options]
bash
# ── Basic GET ──────────────────────────────────────────────────────────────

# 100 requests, 10 concurrent (defaults)
php artisan tornado api/products

# 1000 requests, 50 at a time
php artisan tornado api/products --requests=1000 --concurrency=50


# ── POST with body ─────────────────────────────────────────────────────────

php artisan tornado api/users \
  --method=POST \
  --requests=500 \
  --concurrency=25 \
  --body='{"name":"John","email":"[email protected]","password":"secret123"}'


# ── With headers ───────────────────────────────────────────────────────────

php artisan tornado api/orders \
  --method=POST \
  --requests=200 \
  --header="Authorization: Bearer YOUR_TOKEN" \
  --header="Accept: application/json" \
  --body='{"product_id":1,"qty":2}'


# ── External URL ───────────────────────────────────────────────────────────

php artisan tornado https://api.example.com/v1/products --requests=300


# ── Summary only (hide live feed) ──────────────────────────────────────────

php artisan tornado api/products --requests=1000 --no-live


# ── Interactive mode (no arguments needed) ─────────────────────────────────

php artisan tornado
bash
php artisan tornado:sequence {file?} [options]
bash
php artisan tornado api/users --method=POST --requests=500 --smart
bash
php artisan tornado api/orders --method=POST --requests=500 --auth=sanctum
bash
# JSON export
php artisan tornado api/users --requests=1000 --export=json

# HTML export (beautiful report with charts)
php artisan tornado api/users --requests=1000 --export=html

storage/tornado/tornado_api-users_2024-01-15_14-30-22.html
storage/tornado/tornado_api-users_2024-01-15_14-30-22.json
bash
php artisan tornado:sequence

  [  1/1000] [█░░░░░░░░░░░░░░░░░░░]  200   43.2ms
  [  2/1000] [█░░░░░░░░░░░░░░░░░░░]  200   38.7ms
  [  3/1000] [█░░░░░░░░░░░░░░░░░░░]  500  210.1ms  → Internal Server Error