Download the PHP package saroven/laravel-reportify without Composer

On this page you can find all versions of the php package saroven/laravel-reportify. 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 laravel-reportify

Reportify ๐Ÿš€

Latest Version on Packagist GitHub Tests Action Status Total Downloads Demo Repository

Reportify is a unified, high-performance report generation and document export engine for Laravel applications. Easily stream or export PDFs (via mPDF), Excel (.xlsx), CSV, TXT, and ZIP archives using clean Laravel syntax, event-driven background queues, and customizable Blade templates.


๐ŸŽฎ Demo Application

A complete working demo showing User Directory exports, PDF streaming, and a full Download Manager lifecycle implementation is available at:

๐Ÿ‘‰ https://github.com/saroven/laravel-reportify-demo


๐Ÿ“ฆ Features


๐Ÿ“– About

This package started from a recurring problem: every Laravel project with reporting needs ends up with the same scattered code โ€” mPDF calls in controllers, memory crashes on large datasets, separate queue jobs per format, and footer/header logic copied between files.

Reportify pulls all of that into one place. You define what data to export via a Reportable class, pick a format, and the rest is handled โ€” chunking for large PDFs, queuing, event dispatching, Blade templates for headers and footers, and ZIP packaging. The same interface works for every format, so there's nothing new to learn when you add a second export type to a controller.

A few things worth knowing before you start:


โšก Installation

Install the package via Composer:

Publish the configuration file and Blade views (optional):


๐Ÿš€ Quick Start

1. Make any Controller Exportable

Implement the Reportable interface and use the HasReportify trait on your controller:


2. Generate Dedicated Export Classes

Generate a dedicated Reportable export class using the Artisan generator command:

This creates app/Exports/UserExport.php:

Dispatch background exports manually using ProcessReportJob:


3. Synchronous PDF Streaming

Stream a generated PDF directly to the browser for inline preview or printing:


4. PDF Chunking & Large Dataset Processing (pdfChunk)

When exporting large datasets (e.g. 5,000 to 50,000+ records), rendering everything in a single mPDF memory buffer can trigger memory limit crashes or mPDF backtrack errors. Reportify solves this with PDF Chunking & Merging:

In Controllers via HasReportify:

Simply pass ?export=pdfChunk in request parameters:

How PDF Chunking Works:

  1. Splits records into batches based on config('reportify.chunk_size', 2000).
  2. Generates standalone PDF parts in temporary storage without memory overflow.
  3. Merges all chunked PDF parts into a single output PDF using mPDF's page template importer.
  4. Automatically cleans up temporary chunk files from storage.
  5. Stamps the footer (page numbers, print date, "printed by") once onto the merged file, so page numbering runs across the whole document. Your own hide* flags in $additionalData still apply to that final footer.

4. Direct Multi-Format Exports

Export directly using the Reportify Facade or reportify() global helper:


5. Listen to Export Events (Building a Download Manager)

Reportify dispatches native Laravel events during the export processing lifecycle (ExportStarted, ExportCompleted, ExportFailed). You can listen to these events in AppServiceProvider.php to track job statuses and build a Download Manager:

Then create a DownloadController to serve the generated files:


6. Add Export Buttons & Scripts to Blade Layouts

Include drop-in action buttons in your views:

Include <x-reportify-scripts /> in your master layout template (layouts/app.blade.php) for automatic query parameter preservation:


โš™๏ธ Configuration Reference (config/reportify.php)


๐Ÿ—‚ $additionalData Reference

All export methods accept an $additionalData array for per-report customisation. The most commonly used keys:

Key Type Description
filename string Custom output filename (without extension)
export_id string Unique tracking UUID for the export job (auto-generated if omitted)
file_dir string Override the output directory
orientation string PDF orientation: 'P' (portrait) or 'L' (landscape)
paper_size string mPDF paper size, e.g. 'A4', 'A3', 'Letter'
headerHtml string Raw HTML string injected into the PDF header
headerMargin int Hard override for the PDF top margin in mm โ€” skips auto-calculation entirely
additionalHeaderMargin int Additive nudge added on top of the auto-calculated (or overridden) margin. Accepts negative values
hidePdfHeader bool Hide the PDF header entirely
hidePdfFooter bool Hide the PDF footer entirely
hidePageNumber bool Hide page number in footer
hidePrintDate bool Hide print date in footer
hidePrintBy bool Hide "printed by" user stamp in footer
hidePoweredBy bool Hide "Powered by Reportify" line in footer
hideVersionNumber bool Hide version number in footer
additionalFooter string Extra HTML appended to the PDF footer
separator string Column delimiter for TXT exports (default: \|). A heading line from the row keys is always written first
extension string File extension for TXT exports (default: txt). Use 'none' for no extension
no_data_exception_disabled bool Allow export to proceed with an empty dataset instead of throwing
data_chunk_size int Override chunk size for this export only

Header Margin Priority

For PDF exports the top margin is resolved in this order:

Examples:


๐ŸŒ API Controller Support

HasReportify::exportReport() automatically detects whether the request expects JSON and returns the appropriate response โ€” no extra configuration needed:

Override reportifyExportResponse() in your controller for fully custom behaviour:


๐Ÿข Multi-Tenancy Support

Reportify works seamlessly with multi-tenant Laravel packages including stancl/tenancy and spatie/laravel-multitenancy. Because ProcessReportJob implements Laravel's standard ShouldQueue interface and avoids storing Eloquent models in its constructor, tenant contexts are automatically preserved across queued export workers without serialization errors.

stancl/tenancy

When using stancl/tenancy, background exports are automatically tenant-aware via the QueueTenancyBootstrapper:

  1. Context Preservation: The current tenant_id is captured on dispatch and restored before handle() executes.
  2. Database Queues: Ensure your jobs table uses a central database connection:

  3. Storage Isolation: If FilesystemTenancyBootstrapper is enabled, disks are automatically scoped. Alternatively, isolate paths using $additionalData['file_dir']:

  4. Event Listeners: If your downloads table is in the central database, wrap event listeners in tenancy()->central():

spatie/laravel-multitenancy

spatie/laravel-multitenancy works out of the box when queue tenant awareness is enabled in config/multitenancy.php:

Comparison Matrix

Feature stancl/tenancy spatie/laravel-multitenancy
Queue Tenant Awareness Automatic via QueueTenancyBootstrapper Automatic when queues_are_tenant_aware_by_default => true
Model Serialization Risk None (ProcessReportJob uses scalar IDs) None (ProcessReportJob uses scalar IDs)
Storage Scoping Built-in via filesystem bootstrapper Handled via $additionalData['file_dir']

๐Ÿงช Testing

Run the test suite using Pest PHP:

53 tests, 94 assertions.


๐Ÿค Contributing

Contributions are welcome! Please review CONTRIBUTING.md for details on code style, testing standards, and the pull request submission process.


๐Ÿ’ณ Credits


๐Ÿ“œ License

The MIT License (MIT). See LICENSE.md for details.


All versions of laravel-reportify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^9.0|^10.0|^11.0|^12.0|^13.0
mpdf/mpdf Version ^8.0
maatwebsite/excel Version ^3.1|^4.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 saroven/laravel-reportify contains the following files

Loading the files please wait ...