Download the PHP package moshontong/excel-export-streamer without Composer

On this page you can find all versions of the php package moshontong/excel-export-streamer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package excel-export-streamer

Mosh Excel Export Streamer

Latest Version on Packagist Total Downloads License

A memory-efficient Laravel package for exporting Excel files without running into memory limits. Features true streaming for CSV exports and memory-optimized file generation for XLSX exports. Perfect for exporting millions of records safely and efficiently.

Features

How It Works

The package uses different approaches optimized for each export format:

CSV Exports 🚀

XLSX Exports 📊

💡 Pro Tip: Choose CSV for maximum performance and true streaming. Choose XLSX when Excel compatibility and formatting are required.

Installation

Install via Composer:

The package will auto-register via Laravel's package discovery.

Publish Configuration (Optional)

Basic Usage

1. Inject the Service

2. Export from Eloquent Query

3. Export from Array

4. Advanced Usage with Custom Data Provider

5. Data Mapper for Complex Transformations

Transform data row-by-row during streaming with custom callbacks. Perfect for complex calculations, relationship data, and custom formatting:

Data Mapper Benefits:

Advanced Example - Financial Report:

6. Multi-Sheet XLSX Export

Create XLSX files with multiple worksheets in a single file:

Basic Multi-Sheet Export

Advanced Multi-Sheet with Data Mappers 🎯

Combine multi-sheet functionality with data transformation for powerful business reports:

Multi-Sheet Data Mapper Features:

Logging

The package includes comprehensive logging capabilities:

Log entries include:

Configuration

The package comes with sensible defaults, but you can customize everything:

Model Integration

Make your Eloquent models exportable:

Frontend Integration Examples

Vanilla JavaScript

Vue.js Example

Performance Tips

Format Selection

  1. Choose CSV for True Streaming: For maximum performance and immediate download, use CSV format
  2. Use XLSX When Excel Compatibility Required: Accept the trade-off of file generation for proper Excel support
  3. Consider Dataset Size: CSV handles millions of records with constant memory usage; XLSX uses temporary files

Optimization Strategies

  1. Optimize Chunk Size: Start with 1000 for XLSX, 2000+ for CSV; adjust based on your data complexity
  2. Use Specific Columns: Only select columns you need - especially important for XLSX temporary file size
  3. Add Database Indexes: Ensure your queries are optimized for the columns you're ordering by
  4. Use Data Mappers for Complex Logic: Instead of pre-processing data, use mapper callbacks for transformations during streaming
  5. Monitor Memory Usage: Enable memory warnings in config to track usage patterns
  6. Enable Query Log Disabling: Set disable_query_log to true in config for better performance

XLSX-Specific Tips

  1. Temporary Directory: Configure fast storage (SSD) for temp_dir in XLSX config
  2. Cleanup Monitoring: Large XLSX exports create temporary files - ensure adequate disk space

Error Handling

Testing

Requirements

License

MIT License. See LICENSE file for details.

Contributing

Pull requests are welcome! Please ensure tests pass and follow PSR-12 coding standards.

Support


All versions of excel-export-streamer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moshontong/excel-export-streamer contains the following files

Loading the files please wait ...