PHPackages                             guagualai/query-builder-helper - 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. guagualai/query-builder-helper

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

guagualai/query-builder-helper
==============================

組出 SQL 語法以及把參數帶上去

v1.0.0(1y ago)02MITPHPPHP &gt;= 7.4

Since Jun 26Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

QueryBuilderHelper
==================

[](#querybuilderhelper)

QueryBuilderHelper is a PHP package designed to work with Laravel's Eloquent query builder. It provides a convenient way to get the raw SQL query along with its bindings, which can be useful for debugging and logging.

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

[](#installation)

You can install the package via composer:

```
composer require guagualai/query-builder-helper
```

Usage
-----

[](#usage)

Here's a simple example of how to use QueryBuilderHelper:

```
use Guagualai\QueryBuilderHelper\SqlHelper;
use Illuminate\Database\Eloquent\Model;

class YourModel extends Model
{
    // Your model's methods...
}

$query = YourModel::where('column', 'value')->getQuery();
$sqlWithBindings = SqlHelper::getWithBindings($query);

echo $sqlWithBindings;
```

This will output the raw SQL query with the bindings included, making it easier to see the actual query that will be run against the database.

Example Output
--------------

[](#example-output)

When you use the QueryBuilderHelper, you might see output similar to the following:

```
// Example Eloquent query
$query = YourModel::where('name', 'John')->where('age', '>', 25)->getQuery();
$sqlWithBindings = SqlHelper::getWithBindings($query);

echo $sqlWithBindings;
```

The output will be:

```
select * from `your_models` where `name` = 'John' and `age` > 25
```

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

686d ago

### Community

Maintainers

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

---

Top Contributors

[![XasonLai](https://avatars.githubusercontent.com/u/12758654?v=4)](https://github.com/XasonLai "XasonLai (6 commits)")

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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