PHPackages                             ibekzod/visual-report-builder - 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. ibekzod/visual-report-builder

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

ibekzod/visual-report-builder
=============================

Visual Report Builder for Laravel - Build multi-dimensional pivot tables and reports without code. Like Kyubit.com

1.0.12(3mo ago)1596↓29.2%MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4

Since Jan 14Pushed 3mo agoCompare

[ Source](https://github.com/iBekzod/visual-report-builder)[ Packagist](https://packagist.org/packages/ibekzod/visual-report-builder)[ Docs](https://github.com/ibekzod/visual-report-builder)[ RSS](/packages/ibekzod-visual-report-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (14)Used By (0)

Visual Report Builder
=====================

[](#visual-report-builder)

A complete, production-ready Laravel package for creating pivot tables, visual reports, and analytics dashboards with drag-and-drop template creation and template-based execution.

Features
--------

[](#features)

- **Drag-and-Drop Template Builder** - Create reports visually without writing code
- **Template-Based Execution** - Execute pre-defined templates with dynamic filters
- **Multi-Dimensional Pivot Tables** - Group data by unlimited dimensions and metrics
- **Universal Data Source Support** - Works with any Eloquent model automatically
- **6 Aggregate Functions** - SUM, AVG, MIN, MAX, COUNT, COUNT\_DISTINCT
- **Multiple Export Formats** - CSV, Excel, PDF, JSON
- **REST API** - Complete API for programmatic access
- **Zero Configuration** - Works out of the box with Laravel auto-discovery
- **Database Agnostic** - PostgreSQL, MySQL, MariaDB, SQLite, SQL Server
- **Modern UI** - Clean, minimalistic Laravel-style design

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x or 11.x
- Any supported database (PostgreSQL, MySQL, SQLite, SQL Server)

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

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require ibekzod/visual-report-builder
```

### Step 2: Run Migrations

[](#step-2-run-migrations)

```
php artisan migrate
```

### Step 3: Access the Dashboard

[](#step-3-access-the-dashboard)

Navigate to your application:

```
http://yourapp.test/visual-reports

```

The package auto-discovers your Eloquent models and is ready to use immediately.

Quick Start Guide
-----------------

[](#quick-start-guide)

### Creating Your First Report Template

[](#creating-your-first-report-template)

1. Go to `http://yourapp.test/visual-reports`
2. Click the **"Create Template"** button in the header
3. Select a data source (model) from the dropdown
4. Drag dimension fields to the **Row Dimensions** or **Column Dimensions** zones
5. Drag metric fields to the **Metrics** zone
6. Click **"Preview"** to see the data
7. Click **"Save Template"** and fill in the template details
8. Your template now appears in the dashboard for all users

### Executing Reports

[](#executing-reports)

1. Go to `http://yourapp.test/visual-reports` (Dashboard)
2. Select a template from the left sidebar
3. Apply any filters in the filter panel
4. Click **"Run Report"** to execute
5. View results as table or chart
6. Export to CSV, Excel, PDF, or JSON
7. Save the report to your personal library

Architecture Overview
---------------------

[](#architecture-overview)

### Two Complementary Workflows

[](#two-complementary-workflows)

#### Template Creation (Builder)

[](#template-creation-builder)

```
Admin/Power User → /visual-reports/builder
    → Select Model (auto-discovered from app/Models)
    → Drag Dimensions (row, column grouping)
    → Drag Metrics (aggregated values)
    → Preview Results
    → Save as Template
    → Available to All Users

```

#### Template Execution (Dashboard)

[](#template-execution-dashboard)

```
All Users → /visual-reports (Dashboard)
    → Select Template (from sidebar)
    → Apply Filters (dynamic, based on template)
    → View Results (table, line, bar, pie, area charts)
    → Export (CSV, Excel, PDF, JSON)
    → Save Report (personal library)

```

### Core Components

[](#core-components)

#### Services

[](#services)

ServicePurpose`DataSourceManager`Auto-discovers models, columns, and relationships using PHP Reflection`QueryBuilder`Generates dynamic SQL with GROUP BY, aggregates, HAVING, and JOINs`TemplateExecutor`Executes templates with user-selected filter values`PivotEngine`Creates pivot table structures from flat query results`AggregateCalculator`Computes sum, avg, min, max, count, count\_distinct`FilterManager`Applies dynamic filter conditions to queries`ExporterFactory`Creates appropriate exporter for each format#### Models

[](#models)

ModelPurpose`ReportTemplate`Template definition (model, dimensions, metrics, filters, category)`TemplateFilter`Filter configurations with operators and default values`ReportResult`Saved report executions with user-applied filters#### Controllers

[](#controllers)

ControllerPurpose`BuilderController`Model discovery, relationships, template creation`TemplateController`Template CRUD, execution, filtering, export`DashboardController`Dashboard statistics and overviewUsage
-----

[](#usage)

### Web Interface

[](#web-interface)

The package provides two main views:

#### Dashboard (`/visual-reports`)

[](#dashboard-visual-reports)

- Template selection sidebar organized by category
- Statistics cards showing templates, saved reports, favorites
- Report display area with table and chart views
- Filter panel for applying dynamic filters
- Export and save functionality

#### Builder (`/visual-reports/builder`)

[](#builder-visual-reportsbuilder)

- Two-panel layout: Configuration (left) + Available Fields (right)
- Color-coded draggable fields:
    - **Blue border** = Dimensions (text, date, boolean columns)
    - **Green border** = Metrics (numeric columns)
- Drop zones for Row Dimensions, Column Dimensions, and Metrics
- Live JSON preview before saving
- Modal for template metadata (name, category, description, icon)

### PHP Code Usage

[](#php-code-usage)

```
