Building a Dynamic Report Generator in Laravel
Laravel Dynamic Query Builder Package Query Builder Package simplifies dynamic report generation for both developers and non-technical users. It eliminates the complexity of writing SQL queries manually which can be overwhelming when dealing with multiple tables, conditions and calculations. With an intuitive interface, users can build queries by selecting tables, adding filters, applying conditions and grouping data to generate custom reports in minutes. This not only saves time but also reduces manual coding and errors to get data fast and accurate. What is the Query Builder Package The main purpose of Dynamic Laravel Query Builder Package is to give developers a robust and efficient tool to generate dynamic reports. Instead of writing SQL queries manually, developers can use this package to build queries through an intuitive interface and save time and reduce errors. By providing a user friendly way to build complex reports without requiring deep SQL knowledge, the package boosts productivity and data management. Features Select the main table to query. Add optional join tables using left joins. Choose columns to display. Apply conditions using operators and values. Group by columns with aggregation functions like SUM and GROUP_CONCAT. Assign alias to grouped data. Save, edit, delete and execute queries dynamically. Installation Run the following command to install the package: composer require webbycrown/query-builder:dev-main Migrations Run the following command to migrate the database tables: php artisan migrate --path=vendor/webbycrown/query-builder/src/Database/migrations ENV Settings 1. Database Configuration for Query Management: Set the following variables in your .env file: QDB_CONNECTION=mysql QDB_HOST=127.0.0.1 QDB_PORT=3306 QDB_DATABASE= QDB_USERNAME= QDB_PASSWORD= 2. Table & Column Display Options: Set the format for table and column names with: QDB_LABEL_MODE="Both" Comment: Displays only the comment, if available. Column: Shows the actual database table or column name. Both (default): Displays both the original database name and its comment. Usage 1.Access URL: Go to http://127.0.0.1:8000/queries 2.Create a Query: Go to Add Query to configure your query: * Main Table: Select the table to query. Joining Tables (Optional): Define relationships. Select Columns: Choose columns to fetch. Conditions: Set WHERE clauses. Group By: Apply GROUP BY with aggregation. Save Query: Save the query for future use. 3.View Saved Queries: View saved queries in Query Lists. 4.Edit or Delete Queries: Edit or delete queries from list. 5.Run Queries: Click on a saved query to view the result in table format. ### Upcoming Features Query Builder Package will have more features and ease of use. Future updates will include: Custom Conditions: HAVING and BETWEEN conditions. Grouping & Aggregations: Support for AVG(), MIN(), MAX(), COUNT(). Sorting & Ordering: ORDER BY. Limit & Offset: Control number of rows retrieved. Export Options: Download reports in CSV, Excel, PDF, JSON formats. Contributor Suggestions We accept contributions! If you have ideas for new features or improvements, open a pull request or create an issue in our repository. License Open source and licensed under MIT.

Laravel Dynamic Query Builder Package
Query Builder Package simplifies dynamic report generation for both developers and non-technical users. It eliminates the complexity of writing SQL queries manually which can be overwhelming when dealing with multiple tables, conditions and calculations. With an intuitive interface, users can build queries by selecting tables, adding filters, applying conditions and grouping data to generate custom reports in minutes. This not only saves time but also reduces manual coding and errors to get data fast and accurate.
What is the Query Builder Package
The main purpose of Dynamic Laravel Query Builder Package is to give developers a robust and efficient tool to generate dynamic reports. Instead of writing SQL queries manually, developers can use this package to build queries through an intuitive interface and save time and reduce errors. By providing a user friendly way to build complex reports without requiring deep SQL knowledge, the package boosts productivity and data management.
Features
- Select the main table to query.
- Add optional join tables using left joins.
- Choose columns to display.
- Apply conditions using operators and values.
- Group by columns with aggregation functions like SUM and GROUP_CONCAT.
- Assign alias to grouped data.
- Save, edit, delete and execute queries dynamically.
Installation
Run the following command to install the package:
composer require webbycrown/query-builder:dev-main
Migrations
Run the following command to migrate the database tables:
php artisan migrate --path=vendor/webbycrown/query-builder/src/Database/migrations
ENV Settings
1. Database Configuration for Query Management:
Set the following variables in your .env file:
QDB_CONNECTION=mysql QDB_HOST=127.0.0.1 QDB_PORT=3306 QDB_DATABASE=
QDB_USERNAME= QDB_PASSWORD=
2. Table & Column Display Options:
Set the format for table and column names with:
QDB_LABEL_MODE="Both"
- Comment: Displays only the comment, if available.
- Column: Shows the actual database table or column name.
- Both (default): Displays both the original database name and its comment.
Usage
1.Access URL:
Go to http://127.0.0.1:8000/queries
2.Create a Query:
Go to Add Query to configure your query: * Main Table: Select the table to query.
- Joining Tables (Optional): Define relationships.
- Select Columns: Choose columns to fetch.
- Conditions: Set WHERE clauses.
- Group By: Apply GROUP BY with aggregation.
- Save Query: Save the query for future use.
3.View Saved Queries:
View saved queries in Query Lists.
4.Edit or Delete Queries:
Edit or delete queries from list.
5.Run Queries:
Click on a saved query to view the result in table format.
### Upcoming Features
Query Builder Package will have more features and ease of use. Future updates will include:
- Custom Conditions: HAVING and BETWEEN conditions.
- Grouping & Aggregations: Support for AVG(), MIN(), MAX(), COUNT().
- Sorting & Ordering: ORDER BY.
- Limit & Offset: Control number of rows retrieved.
- Export Options: Download reports in CSV, Excel, PDF, JSON formats.
Contributor Suggestions
We accept contributions! If you have ideas for new features or improvements, open a pull request or create an issue in our repository.
License
Open source and licensed under MIT.