PHPackages                             bharatbkj/laravel-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. [API Development](/categories/api)
4. /
5. bharatbkj/laravel-report-builder

ActiveLibrary[API Development](/categories/api)

bharatbkj/laravel-report-builder
================================

Natural-language report builder UI and API for Laravel applications.

v1.0.0(2w ago)011MITPHPPHP ^8.2

Since May 23Pushed 2w agoCompare

[ Source](https://github.com/bharatbkj/report-builder)[ Packagist](https://packagist.org/packages/bharatbkj/laravel-report-builder)[ RSS](/packages/bharatbkj-laravel-report-builder/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (1)

Laravel Report Builder
======================

[](#laravel-report-builder)

Installable Laravel package that converts plain-English report requests into safe read-only reports against the host application's database.

Features
--------

[](#features)

- Compact Report Builder UI.
- JSON report endpoint for admin panel integrations.
- Explicit table allowlist.
- Explicit join allowlist.
- Protected-column filtering.
- Column selection, numeric filters, text filters, ranges, sorting, and counts.
- CSV, JSON, and Print PDF actions in the packaged UI.
- Query execution time and optional audit logs.
- No generated SQL returned to users.

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

[](#requirements)

- PHP 8.2 or newer.
- Laravel 11 or Laravel 12.

Install
-------

[](#install)

After publishing this package in a Composer repository:

```
composer require bharatbkj/laravel-report-builder
php artisan vendor:publish --tag=report-builder-config
php artisan vendor:publish --tag=report-builder-migrations
php artisan migrate
```

For local development from a package directory, add a Composer path repository in the host application's `composer.json`:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/report-builder"
        }
    ]
}
```

Then run:

```
composer require bharatbkj/laravel-report-builder:@dev
```

Laravel discovers `ReportBuilder\ReportBuilderServiceProvider` automatically.

Configure Tables
----------------

[](#configure-tables)

The package queries no tables by default. In `config/report-builder.php`, permit business-reporting tables only:

```
'allowed_tables' => [
    'students' => [
        'label' => 'Students',
        'aliases' => ['student', 'learners'],
    ],
    'student_attendances' => [
        'label' => 'Attendance',
        'aliases' => ['attendance', 'attendances'],
    ],
],

'column_aliases' => [
    'student_attendances' => [
        'attendance_percent' => ['attendance', 'attendance percentage'],
    ],
],

'value_lookup_columns' => [
    'students' => ['name', 'course'],
    'student_attendances' => ['month', 'status'],
],
```

Only configure lookup columns where discovering values for natural-language matching is acceptable.

Configure Safe Joins
--------------------

[](#configure-safe-joins)

Joins occur only when defined in configuration:

```
'relationships' => [
    [
        'left_table' => 'students',
        'left_key' => 'id',
        'right_table' => 'student_attendances',
        'right_key' => 'student_id',
        'aliases' => ['attendance', 'attendances'],
    ],
],
```

Example questions after this configuration:

```
show BCA students with attendance below 90 only name course marks attendance status
show MBA students with marks above 80 and attendance over 90 only name marks attendance status
count BCA students with attendance below 90

```

Routes
------

[](#routes)

The UI route is enabled by default with `web` and `auth` middleware:

```
GET  /report-builder
GET  /report-builder/meta
POST /report-builder/query

```

For an external API integration, first configure a suitable authentication middleware, then enable API routes:

```
'api' => [
    'enabled' => true,
    'prefix' => 'api/report-builder',
    'middleware' => ['api', 'auth:sanctum', 'throttle:60,1'],
],
```

API endpoints:

```
GET  /api/report-builder/meta
POST /api/report-builder/query

```

Request:

```
{
    "query": "show BCA students only name and marks with marks above 80"
}
```

Response:

```
{
    "question": "show BCA students only name and marks with marks above 80",
    "data": [],
    "columns": [],
    "row_count": 0,
    "summary": "0 rows returned.",
    "suggestions": [],
    "meta": {
        "execution_ms": 10,
        "limited_to": 500,
        "joined": false
    }
}
```

Security
--------

[](#security)

- Leave authentication enabled for every UI and API route.
- Allowlist only report tables required by the client.
- Configure joins explicitly.
- Keep passwords, tokens, session values, secrets, and private attributes blocked.
- Use a read-only database connection when the report builder connects to a reporting replica or separate database.
- Limit searchable value columns and keep the row limit bounded.
- Publish and run the audit migration for production use.

Customizing The UI
------------------

[](#customizing-the-ui)

Publish the Blade view:

```
php artisan vendor:publish --tag=report-builder-views
```

The host application can then customize:

```
resources/views/vendor/report-builder/index.blade.php

```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance96

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

18d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/bharatbkj-laravel-report-builder/health.svg)

```
[![Health](https://phpackages.com/badges/bharatbkj-laravel-report-builder/health.svg)](https://phpackages.com/packages/bharatbkj-laravel-report-builder)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M120](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

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