Laravel Ingest Demo

February 4, 2026 ยท View on GitHub

Demonstration of the zappzerapp/laravel-ingest package for efficient CSV imports with performance benchmarking.

Prerequisites

  • Docker
  • Docker Compose

Quick Start

  1. Start Docker container:

    docker compose up -d
    
  2. Wait for the container to finish setup (PHP extensions and Composer install):

    # Check if ready
    docker compose exec app php -m | grep pdo_sqlite
    
  3. Run migrations:

    docker compose exec app php artisan migrate:fresh --force
    
  4. Generate test CSV files:

    docker compose exec app php artisan csv:generate
    
  5. Run benchmark:

    docker compose exec app php artisan benchmark:ingest --clear
    

Architecture

  • Docker: PHP 8.3-CLI with SQLite
  • Database: SQLite (file-based, no separate container needed)
  • Queue: Sync driver (no queue worker needed)
  • Laravel: Version 11.x
  • Package: zappzerapp/laravel-ingest
  • Model: Product (SKU, Name, Description, Price, Category, Stock)
  • Importer: ProductImporter with UPDATE strategy

CLI Commands

CommandDescription
csv:generateGenerate test CSV files (100, 1K, 10K rows)
ingest:run productimporter --file=csv/products_1000.csvImport CSV file
benchmark:ingest --clearBenchmark with all CSV sizes
ingest:listShow available importers

Benchmark Results (SQLite)

CSV SizeRows ImportedDuration (s)Memory (MB)Rows/Sec.
1001000.196.00520
1,0001,0001.362.00735
10,00010,00012.450.00803
100,000100,000124.312.00804

Troubleshooting

Problem: Container won't start
Solution: docker compose down -v && docker compose up -d

Problem: Permission denied with Artisan
Solution: docker compose exec app chmod -R 777 storage bootstrap/cache database

Problem: SQLite database not found
Solution: docker compose exec app touch database/database.sqlite

GitHub Actions

This repository includes a GitHub Actions workflow (.github/workflows/benchmark-docker.yml) that automatically runs the benchmark on every pull request and push to main.

License

MIT License