PHPackages                             jimmyjs/pdf-report-generators - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. jimmyjs/pdf-report-generators

Abandoned → [jimmyjs/laravel-report-generator](/?search=jimmyjs%2Flaravel-report-generator)Library[PDF &amp; Document Generation](/categories/documents)

jimmyjs/pdf-report-generators
=============================

Rapidly Generate Simple Pdf Report on Laravel 5 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy)

1.3.4(9y ago)12151[1 issues](https://github.com/Jimmy-JS/pdf-report-generators/issues)MITHTMLPHP &gt;=5.5.9

Since Feb 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Jimmy-JS/pdf-report-generators)[ Packagist](https://packagist.org/packages/jimmyjs/pdf-report-generators)[ RSS](/packages/jimmyjs-pdf-report-generators/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (13)Used By (0)

This package is deprecated!
===========================

[](#this-package-is-deprecated)

Please go to  instead!

Laravel - Pdf Report Generators
===============================

[](#laravel---pdf-report-generators)

Rapidly Generate Simple Pdf Report on Laravel (Using [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf))

This package provides a simple pdf generators to speed up your workflow

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

[](#installation)

Add package to your composer:

```
composer require jimmyjs/pdf-report-generators

```

Then, add the ServiceProvider to the providers array in config/app.php

```
Jimmyjs\PdfReportGenerators\ServiceProvider::class,

```

Usage
-----

[](#usage)

This package is make use of `chunk` method (Eloquent / Query Builder) so it can handle big data without memory exhausted.

Also, You can use `PdfReportGenerator` facade for shorter code that already registered as an alias for `Jimmyjs\PdfReportGenerators\Facade` class.

### Example Code

[](#example-code)

```
use PdfReportGenerator;

public function displayReport(Request $request) {
	// Retrieve any filters
	$fromDate = $request->input('from_date');
	$toDate = $request->input('to_date');
	$sortBy = $request->input('sort_by');

	// Report title
	$title = 'Registered User Report';

	// For displaying filters description on header
	$meta = [
		'Registered on' => $fromDate . ' To ' . $toDate,
		'Sort By' => $sortBy
	];

	// Do some querying..
	$queryBuilder = User::select(['name', 'balance', 'registered_at'])
						->whereBetween('registered_at', [$fromDate, $toDate])
						->orderBy($sortBy);

	// Set Column to be displayed
	$columns = [
		'Name' => 'name',
		'Registered At' => 'registered_at',
		'Total Balance' => 'balance',
		'Status' => function($result) { // You can do if statement or any action do you want inside this closure
			return ($result->balance > 100000) ? 'Rich Man' : 'Normal Guy';
		}
	];

	/*
		Generate Report with flexibility to manipulate column class even manipulate column value (using Carbon, etc).

		- of()         : Init the title, meta (filters description to show), query, column (to be shown)
		- editColumn() : To Change column class or manipulate its data for displaying to report
		- showTotal()  : Used to sum all value on specified column on the last table (except using groupBy method). 'point' is a type for displaying total with a thousand separator
		- groupBy()    : Show total of value on specific group. Used with showTotal() enabled.
		- limit()      : Limit record to be showed
		- make()       : Will producing DomPDF instance so you could do any other DomPDF method such as stream() or download()
	*/
	return PdfReportGenerator::of($title, $meta, $queryBuilder, $columns)
				->editColumn('Registered At', [
					'displayAs' => function($result) {
						return $result->registered_at->format('d M Y');
					}
				])
				->editColumn('Total Balance', [
					'class' => 'right bold',
					'displayAs' => function($result) {
						return thousandSeparator($result->balance);
					}
				])
				->editColumn('Status', [
					'class' => 'right bold'
				])
				->showTotal([
					'Total Balance' => 'point'
				])
				->limit(20)
				->make()
				->stream(); // or download() to download pdf
}
```

### Note

[](#note)

```
$columns = [
	'Name' => 'name',
	'Registered At' => 'registered_at',
	'Total Balance' => 'balance',
	'Status' => function($result) { // You can do if statement or any action do you want inside this closure
		return ($result->balance > 100000) ? 'Rich Man' : 'Normal Guy';
	}
];
```

Will produce a same result with:

```
$columns = [
	'Name' => function($result) {
		return $result->name;
	},
	'Registered At' => function($result) {
		return $result->registered_at;
	},
	'Total Balance' => function($result) {
		return $result->balance;
	},
	'Status' => function($result) { // You can do if statement or any action do you want inside this closure
		return ($result->balance > 100000) ? 'Rich Man' : 'Normal Guy';
	}
];
```

So you can do some **eager loading** like:

```
$post = Post::with('comment')->where('active', 1);

$columns = [
	'Post Title' => function($result) {
		return $result->title;
	},
	'Slug' => 'slug',
	'Top Comment' => function($result) {
		return $result->comment->body;
	}
];
```

### Output Report

[](#output-report)

[![Output Report with Grand Total](https://raw.githubusercontent.com/Jimmy-JS/pdf-report-generators/master/screenshots/report-with-total.png)](https://raw.githubusercontent.com/Jimmy-JS/pdf-report-generators/master/screenshots/report-with-total.png)

### Example Code With Group By

[](#example-code-with-group-by)

Or, you can total all records by group using `groupBy` method

```
	...
	// Do some querying..
	$queryBuilder = User::select(['name', 'balance', 'registered_at'])
						->whereBetween('registered_at', [$fromDate, $toDate])
						->orderBy('registered_at', 'ASC'); // You should sort groupBy column to use groupBy() Method

	// Set Column to be displayed
	$columns = [
		'Registered At' => 'registered_at',
		'Name' => 'name',
		'Total Balance' => 'balance',
		'Status' => function($result) { // You can do if statement or any action do you want inside this closure
			return ($result->balance > 100000) ? 'Rich Man' : 'Normal Guy';
		}
	];
	return PdfReportGenerator::of($title, $meta, $queryBuilder, $columns)
				->editColumn('Registered At', [
					'displayAs' => function($result) {
						return $result->registered_at->format('d M Y');
					}
				])
				->editColumn('Total Balance', [
					'class' => 'right bold',
					'displayAs' => function($result) {
						return thousandSeparator($result->balance);
					}
				])
				->editColumn('Status', [
					'class' => 'right bold',
				])
				->groupBy('Registered At')
				->showTotal([
					'Total Balance' => 'point'
				])
				->make()
				->stream(); // or download() to download pdf
```

**PLEASE TAKE NOTE TO SORT GROUPBY COLUMN VIA QUERY FIRST TO USE THIS GROUP BY METHOD.**

### Output Report With Group By

[](#output-report-with-group-by)

[![Output Report with Group By Grand Total](https://raw.githubusercontent.com/Jimmy-JS/pdf-report-generators/master/screenshots/report-with-group-by.png)](https://raw.githubusercontent.com/Jimmy-JS/pdf-report-generators/master/screenshots/report-with-group-by.png)

Other Method
------------

[](#other-method)

### 1. setPaper($paper = 'a4')

[](#1-setpaperpaper--a4)

**Description**: Set Paper Size

**Params**:

- $paper (Default: 'a4')

**Usage:**

```
	PdfReportGenerator::of($title, $meta, $queryBuilder, $columns)
					->setPaper('a6')
					->make();
```

### 2. setCss(Array $styles)

[](#2-setcssarray-styles)

**Description**: Set a new custom styles with given selector and style to apply

**Params**:

- Array $styles (Key: $selector, Value: $style)

**Usage:**

```
	PdfReportGenerator::of($title, $meta, $queryBuilder, $columns)
					->editColumn('Registered At', [
						'class' => 'right bolder italic-red'
					])
					->setCss([
						'.bolder' => 'font-weight: 800;',
						'.italic-red' => 'color: red;font-style: italic;'
					])
					->make();
```

### 3. setOrientation($orientation = 'portrait')

[](#3-setorientationorientation--portrait)

**Description**: Set Orientation to Landscape or Portrait

**Params**:

- $orientation (Default: 'portrait')

**Usage:**

```
	PdfReportGenerator::of($title, $meta, $queryBuilder, $columns)
					->setOrientation('landscape')
					->make();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

12

Last Release

3357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6e0aa80e1b258f3f3b3b66845c2fc241ab9a1d50ed011ca13917f3fd4e6c0e7?d=identicon)[JimmyJS](/maintainers/JimmyJS)

---

Top Contributors

[![Jimmy-JS](https://avatars.githubusercontent.com/u/9798426?v=4)](https://github.com/Jimmy-JS "Jimmy-JS (23 commits)")

---

Tags

laravelpdfpdf-reportreport

### Embed Badge

![Health badge](/badges/jimmyjs-pdf-report-generators/health.svg)

```
[![Health](https://phpackages.com/badges/jimmyjs-pdf-report-generators/health.svg)](https://phpackages.com/packages/jimmyjs-pdf-report-generators)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M709](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M274](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[stevebauman/autodoc-facades

Auto-generate PHP doc annotations for Laravel facades

98186.6k9](/packages/stevebauman-autodoc-facades)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
