guagualai / query-builder-helper
組出 SQL 語法以及把參數帶上去
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:libary
Requires
- php: >= 7.4
- laravel/laravel: >= 6
Requires (Dev)
- php: >= 7.4
- laravel/laravel: >= 6
This package is auto-updated.
Last update: 2024-04-14 04:29:29 UTC
README
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
You can install the package via composer:
composer require guagualai/query-builder-helper
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.
License
The MIT License (MIT). Please see License File for more information.