PHPackages                             webbycrown/query-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. [Database &amp; ORM](/categories/database)
4. /
5. webbycrown/query-builder

ActiveLibrary[Database &amp; ORM](/categories/database)

webbycrown/query-builder
========================

Query Builder for Laravel

1.0.1(6mo ago)1303MITPHP

Since Apr 1Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/webbycrown/query-builder)[ Packagist](https://packagist.org/packages/webbycrown/query-builder)[ RSS](/packages/webbycrown-query-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Laravel Query Builder Package
=============================

[](#laravel-query-builder-package)

Introduction
------------

[](#introduction)

### Simplified Dynamic Report Generation

[](#simplified-dynamic-report-generation)

The **Query Builder Package** is designed to make report generation easy for both developers and non-technical users. Writing SQL queries manually can be complex and time-consuming, especially when handling multiple tables, conditions, and calculations. This package simplifies the process with an intuitive interface that allows users to build queries without needing advanced database knowledge. By selecting tables, adding filters, applying conditions, and grouping data, users can generate custom reports effortlessly. This improves efficiency, reduces manual coding, and minimizes errors, ensuring quick and accurate data retrieval.

The primary goal of the **Query Builder Package** is to empower developers by providing a robust and efficient tool for generating reports dynamically. Traditional SQL query writing can be time-consuming and complex, especially when dealing with multiple joins, conditions, and aggregations. This package simplifies the process by offering an intuitive interface where developers can construct queries without deep SQL knowledge. It enhances productivity by reducing manual coding efforts, minimizing errors, and enabling faster report generation. With built-in support for selecting tables, applying conditions, joining tables, and grouping results, this package ensures that developers can retrieve and display relevant data efficiently.

### Purpose of the Query Builder Package

[](#purpose-of-the-query-builder-package)

The **Laravel Query Builder Package** was created to provide developers with a streamlined and flexible way to generate dynamic reports. Instead of manually writing SQL queries, this package enables developers to construct queries using an intuitive interface, saving time and reducing errors. The goal is to enhance productivity by offering a user-friendly solution for building complex reports without requiring deep SQL expertise.

### Add Query Screen

[](#add-query-screen)

[![Add Query Screen](https://private-user-images.githubusercontent.com/154992408/451361735-76bd3f66-8b52-412a-9e96-ce64b4409075.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYxNzM1LTc2YmQzZjY2LThiNTItNDEyYS05ZTk2LWNlNjRiNDQwOTA3NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mZjU2N2YyYTQ2ZGZiNjA0NWM1YTIyMDFiMTkyNDIxYThkNjQ4YzU2YzQ2NjliNWYyNTQ2MTA2MWNiYTZmNjAwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.LQ_qA7vPhuG7K9saozSYg10llY2RExCxXd4cKP37i5c)](https://private-user-images.githubusercontent.com/154992408/451361735-76bd3f66-8b52-412a-9e96-ce64b4409075.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYxNzM1LTc2YmQzZjY2LThiNTItNDEyYS05ZTk2LWNlNjRiNDQwOTA3NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mZjU2N2YyYTQ2ZGZiNjA0NWM1YTIyMDFiMTkyNDIxYThkNjQ4YzU2YzQ2NjliNWYyNTQ2MTA2MWNiYTZmNjAwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.LQ_qA7vPhuG7K9saozSYg10llY2RExCxXd4cKP37i5c)

### Query List Screen

[](#query-list-screen)

[![Query List Screen](https://private-user-images.githubusercontent.com/154992408/451362034-1a71130f-5129-448b-8914-546c3ef007ff.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYyMDM0LTFhNzExMzBmLTUxMjktNDQ4Yi04OTE0LTU0NmMzZWYwMDdmZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05YjQ1NGVmMjZlN2MxZWRjODZkYzEwMTIzNjdmN2RiNTNiZTZmODEzYzM0MjZiY2Q0MTEzOGUwYTNhYzc0ODJkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0m8p0K1yGEAu57UHq8xq2GQga21vjUmkqNiW8ArNLeQ)](https://private-user-images.githubusercontent.com/154992408/451362034-1a71130f-5129-448b-8914-546c3ef007ff.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYyMDM0LTFhNzExMzBmLTUxMjktNDQ4Yi04OTE0LTU0NmMzZWYwMDdmZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05YjQ1NGVmMjZlN2MxZWRjODZkYzEwMTIzNjdmN2RiNTNiZTZmODEzYzM0MjZiY2Q0MTEzOGUwYTNhYzc0ODJkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0m8p0K1yGEAu57UHq8xq2GQga21vjUmkqNiW8ArNLeQ)

### View Query Screen

[](#view-query-screen)

[![View Query Screen](https://private-user-images.githubusercontent.com/154992408/428625764-a913b485-4ce6-4ec3-a000-eb03e8f0a108.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tI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XMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NzVlM2ViZTVkMGQzMjFmZTg4NGNjODBjN2RjNzQ5M2ZhZmQwOTNkZTk0Mzg0ZDI3MGI1Yjc0NmRmZmEwMjgyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-9U9e_EfhLuBavNOPVhQwWIIAf-UuHdQiXdmn2vQnHk)

### Scheduling Reports List Screen

[](#scheduling-reports-list-screen)

[![Scheduling Reports List Screen](https://private-user-images.githubusercontent.com/154992408/451362422-b8b2dcd9-c629-42ba-8854-f537ad851947.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYyNDIyLWI4YjJkY2Q5LWM2MjktNDJiYS04ODU0LWY1MzdhZDg1MTk0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01YmE0ZjczYWFlOTdhMzc0MDU0YmEyMTQ2ODUzNGYzYWMwOWM3OWRmZjhmODViMmZkYTc4ZTIxNzJlMjBkYzQ1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-tZRq1mJAuUQWx5L-U3ggBE1K2Q0dKlKg8by6h514vs)](https://private-user-images.githubusercontent.com/154992408/451362422-b8b2dcd9-c629-42ba-8854-f537ad851947.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYyNDIyLWI4YjJkY2Q5LWM2MjktNDJiYS04ODU0LWY1MzdhZDg1MTk0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01YmE0ZjczYWFlOTdhMzc0MDU0YmEyMTQ2ODUzNGYzYWMwOWM3OWRmZjhmODViMmZkYTc4ZTIxNzJlMjBkYzQ1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-tZRq1mJAuUQWx5L-U3ggBE1K2Q0dKlKg8by6h514vs)

### Add Scheduled Report Screen

[](#add-scheduled-report-screen)

[![Scheduling Form Screen](https://private-user-images.githubusercontent.com/154992408/451362700-01efa794-7f6d-4b44-ab8b-4db956f96aaf.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDg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YjYyNmI2ZjhlMjhhMGEzNjU3NzU0ZDI1NjVhZjA0MTAxYmU5NGU4ZDU4NzQxMWJlYjc2YjZjOWMwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.RbD2rQGHn7SIicuoPcMIlqCMjA7Z1e9xwxSGm8qpvpw)

### Log List Screen

[](#log-list-screen)

[![Log List Screen](https://private-user-images.githubusercontent.com/154992408/451363050-8065d172-0ed9-44fe-b542-cb51bc310ad4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYzMDUwLTgwNjVkMTcyLTBlZDktNDRmZS1iNTQyLWNiNTFiYzMxMGFkNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZjc5MTMzYTA4NmQ3N2M0YTJkNGZmYmFlZTFkYTVmMDljZjJmZmFhMzc4YmYxZjNjODc5ZjgwYjRlMTA3NTVkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.FJHukN4wmD8WBIeGaouCOemwb4BnuX5uMcmu6IR5bkI)](https://private-user-images.githubusercontent.com/154992408/451363050-8065d172-0ed9-44fe-b542-cb51bc310ad4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYzMDUwLTgwNjVkMTcyLTBlZDktNDRmZS1iNTQyLWNiNTFiYzMxMGFkNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQxOTAwNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZjc5MTMzYTA4NmQ3N2M0YTJkNGZmYmFlZTFkYTVmMDljZjJmZmFhMzc4YmYxZjNjODc5ZjgwYjRlMTA3NTVkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.FJHukN4wmD8WBIeGaouCOemwb4BnuX5uMcmu6IR5bkI)

### Log JSON Screen

[](#log-json-screen)

[![Log JSON Screen](https://private-user-images.githubusercontent.com/154992408/451363276-e5e0621f-91da-4c78-988b-eef21dc9b3ff.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5NDcxNTYsIm5iZiI6MTc3Mzk0Njg1NiwicGF0aCI6Ii8xNTQ5OTI0MDgvNDUxMzYzMjc2LWU1ZTA2MjFmLTkxZGEtNGM3OC05ODhiLWVlZjIxZGM5YjNmZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzR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features
--------

[](#features)

- Select main table for querying
- Add optional join tables (only left join)
- Choose specific columns to display
- Apply conditions using operators and values
- Group results by columns with aggregation functions (SUM, GROUP\_CONCAT, etc.)
- Assign alias names for grouped data
- Save, edit, delete, and execute queries dynamically
- Support additional functions like AVG(), MIN(), MAX(), COUNT(), etc
- Add advanced filtering options such as HAVING and BETWEE
- Implement ORDER BY functionality to sort query results in ASC/DESC order
- Limit &amp; Offset – Allow users to control the number of rows retrieved in query results
- Configure table and column visibility based on settings
- Automatically load language files from the package
- Maintain a history of all executed queries with timestamps and user info
- Automate scheduled report generation with email delivery
- Support advanced condition logic using AND / OR groupings
- Introduce alternate UI screens to enhance usability and workflow

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

[](#installation)

```
composer require webbycrown/query-builder
```

Configuration
-------------

[](#configuration)

### 1. Publish Config File

[](#1-publish-config-file)

Run the following command to publish the query builder configuration file:

```
php artisan vendor:publish --tag=config
```

### 2. Publishing Translations

[](#2-publishing-translations)

If your application includes language files for translations, you can publish the translation files using the following command:

`php artisan vendor:publish --tag=translations`

This will copy all the translation files from the vendor package to your resources/lang directory, where you can modify them as needed.

Run Migrations
--------------

[](#run-migrations)

Before using the package, run the following command to migrate the required database tables:

```
php artisan migrate --path=vendor/webbycrown/query-builder/src/Database/migrations
```

ENV Settings
------------

[](#env-settings)

### 1. Database Configuration for Query Management

[](#1-database-configuration-for-query-management)

Set the following variables in your `.env` file to configure the database used for creating and managing queries:

```
QDB_CONNECTION=mysql
QDB_HOST=127.0.0.1
QDB_PORT=3306
QDB_DATABASE=
QDB_USERNAME=
QDB_PASSWORD=

```

### 2. Table &amp; Column Display Options

[](#2-table--column-display-options)

The format for displaying table and column names can be adjusted using:

```
QDB_LABEL_MODE="Both"

```

Available Options:

- **Comment**: Displays only the descriptive comment assigned to the table or column, if available. Useful for providing user-friendly labels.
- **Column**: Shows the actual database table name or column name as stored in the schema. Ideal for developers who prefer raw database references.
- **Both** (default): Displays both the original database name and its corresponding comment (if available), providing full context for better understanding.

Usage
-----

[](#usage)

### 1. Access URL

[](#1-access-url)

You can access the query builder at:

```
http://127.0.0.1:8000/queries
```

### 2. Middleware and Route Prefix

[](#2-middleware-and-route-prefix)

Modify config/querybuilder.php to set middleware and route prefix:

```
return [
    'middleware' => ['web', 'auth'],   // Middleware for all QueryBuilder routes
    'access_route' => 'queries',       // Prefix for web routes
    'log_page_view' => true,           // Show Log Page link if true
    'reports_page_view' => true,       // Show Reports Page link if true
];

```

### 3. Create a Query

[](#3-create-a-query)

Navigate to **Add Query** page and configure:

- **Main Table**: Select the table to query from.
- **Joining Tables** (Optional): Define relationships.
- **Select Columns**: Choose columns to fetch.
- **Conditions**: Set WHERE clauses.
- **Group By**: Apply GROUP BY with aggregation.
- **Save Query**: Store query for future use.
- **Custom Conditions** : Add advanced filtering options such as HAVING and BETWEEN.
- **Grouping &amp; Aggregations** : Support additional functions like AVG(), MIN(), MAX(), COUNT(), etc.
- **Sorting &amp; Ordering** : Implement ORDER BY functionality to sort query results in ASC/DESC order.
- **Limit &amp; Offset** : Allow users to control the number of rows retrieved in query results.
- **Export Options** : Enable downloading reports in multiple formats, including CSV, Excel, PDF, and JSON.

### 4. View Saved Queries

[](#4-view-saved-queries)

Saved queries can be accessed in the **Query Lists**.

### 5. Edit or Delete Queries

[](#5-edit-or-delete-queries)

Modify or remove queries from the list.

### 6. Run Queries

[](#6-run-queries)

Click on a saved query to view the output in a table format.

Scheduled Report Command
------------------------

[](#scheduled-report-command)

To manually register and bind your custom scheduled reports command, follow these steps:

### 1. Register the Command in `AppServiceProvider.php`

[](#1-register-the-command-in-appserviceproviderphp)

Instead of relying on PSR-4 autoload or Laravel's default auto-discovery, you can manually bind and register the command by modifying the `AppServiceProvider.php` file.

- Open `app/Providers/AppServiceProvider.php`.
- Add the following code inside the `boot()` method:

```
use Webbycrown\QueryBuilder\Console\Commands\GenerateScheduledReports;

public function boot(): void
{
    if ($this->app->runningInConsole()) {
        $this->commands([
            GenerateScheduledReports::class,
        ]);
    }
}
```

### 2. Verify the Command is Registered

[](#2-verify-the-command-is-registered)

After registering the command, you can verify that it's properly registered by running the following command:

`php artisan list | grep reports`This should display the reports:generate command if it has been correctly registered.

### 3. Run the Command

[](#3-run-the-command)

To run the command manually, use:

`php artisan reports:generate`

### 4. Scheduling the Command

[](#4-scheduling-the-command)

If you want to schedule the command to run periodically (e.g., every minute), you can use Laravel's task scheduler. Open the bootstrap/app.php file and add the following scheduling logic:

```
->withSchedule(function (Schedule $schedule) {
    $schedule->command('query-builder:generate-scheduled-reports')->everyMinute();
})

```

Make sure your system’s cron job is configured to run Laravel's scheduler every minute. You can set this up by adding the following line to your system's crontab file:

```
* * * * * php /path/to/your/project/artisan schedule:run >> /dev/null 2>&1

```

### 5. Create a Scheduled Report

[](#5-create-a-scheduled-report)

Navigate to the **Add Scheduled Report** page and configure:

- **Report Type**: Select the report you want to schedule from the list of saved queries.
- **Frequency**: Choose how often the report should be sent: Daily, Weekly, or Monthly.
- **Delivery Time**: Select the exact time the report should be delivered (24-hour format).
- **To Email**: Enter the recipient’s email address (comma-separated if multiple).
- **CC Email**: (Optional) Enter any additional recipients to be CC'd.
- **BCC Email**: (Optional) Enter recipients to be BCC'd.
- **Subject**: Provide a custom subject line for the email. Leave empty to use the default.
- **File Format**: Choose the report format: PDF, XLSX, or CSV.
- **Record Limit**: Set a limit on the number of records included in the report (e.g., 1000).
- **Email Body**: Add custom content to appear in the body of the email. You can use HTML or plain text.
- **Active**: Enable or disable the schedule using this checkbox. Only active schedules will be executed.

### 6. View Saved Scheduled Reports

[](#6-view-saved-scheduled-reports)

Saved scheduled report can be accessed in the **Scheduled Report List**.

### 7. Edit or Delete Scheduled Reports

[](#7-edit-or-delete-scheduled-reports)

Modify or remove scheduled report from the list.

Upcoming Features
-----------------

[](#upcoming-features)

The Query Builder Package is continuously evolving to provide more flexibility and ease of use. Here are some planned features for future updates:

1. **Subquery Support** – Allow users to create nested queries within the main query.

### Contributor Suggestions

[](#contributor-suggestions)

We welcome community contributions! If you have ideas for new features or improvements, feel free to submit a pull request or open an issue on our repository.The Query Builder Package is continuously evolving to provide more flexibility and ease of use. Here are some planned features for future updates:

License
-------

[](#license)

This package is open-source and licensed under the MIT License.

---

📊 Changelog
-----------

[](#-changelog)

### v1.0.1

[](#v101)

- 🔄 Updated package stability from **dev** to **stable** for production readiness
- 📦 Added explicit version declaration in `composer.json` for better version tracking
- 📝 Improved installation documentation with simplified composer command
- ✅ Resolved Bagisto marketplace feedback and code review recommendations
- 🚀 Published stable release to [Packagist](https://packagist.org/packages/webbycrown/query-builder)

---

### v1.0.0

[](#v100)

- ✨ Initial release of **Laravel Query Builder Package**
- 🔍 Dynamic query builder with intuitive interface for developers and non-technical users
- 🔗 Support for left join tables with relationship configuration
- 📊 Column selection with custom conditions using multiple operators
- 📈 Group By functionality with aggregation functions (SUM, GROUP\_CONCAT, etc.)
- 💾 Save, edit, delete, and execute queries dynamically
- ⚙️ Configurable middleware, route prefix, and database connections
- 🌐 Multi-language support with auto-loaded translation files
- 📄 Export capabilities for query results in multiple formats
- 🚀 Published to [Packagist](https://packagist.org/packages/webbycrown/query-builder)

---

 **Made with ❤️ by [WebbyCrown](https://webbycrown.com)**

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance68

Regular maintenance activity

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 54.5% 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 ~113 days

Total

3

Last Release

186d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4be8c491dee65372c701ca519d413336b1d7fc62148a413eb329b087226123c8?d=identicon)[webbycrown](/maintainers/webbycrown)

---

Top Contributors

[![akashcsoni](https://avatars.githubusercontent.com/u/13456290?v=4)](https://github.com/akashcsoni "akashcsoni (6 commits)")[![rohit-ghoghari](https://avatars.githubusercontent.com/u/50444614?v=4)](https://github.com/rohit-ghoghari "rohit-ghoghari (5 commits)")

### Embed Badge

![Health badge](/badges/webbycrown-query-builder/health.svg)

```
[![Health](https://phpackages.com/badges/webbycrown-query-builder/health.svg)](https://phpackages.com/packages/webbycrown-query-builder)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[tomatophp/filament-translations

Manage your translation with DB and cache, you can scan your languages tags like trans(), \_\_(), and get the string inside and translate them use UI.

6230.1k3](/packages/tomatophp-filament-translations)[shibuyakosuke/laravel-ddl-export

Export Table definition to spreadsheet by artisan command.

129.3k](/packages/shibuyakosuke-laravel-ddl-export)[yemenopensource/filament-excel

This package useful for importing excel files into models.

193.8k](/packages/yemenopensource-filament-excel)

PHPackages © 2026

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