Download the PHP package laratoolbox/query-viewer without Composer
On this page you can find all versions of the php package laratoolbox/query-viewer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laratoolbox/query-viewer
More information about laratoolbox/query-viewer
Files in laratoolbox/query-viewer
Package query-viewer
Short Description Get sql queries with bindings replaced
License MIT
Informations about the package query-viewer
Package description
This package adds custom methods to eloquent and database query builder for getting sql query. (question marks replaced with values)
Laravel's toSql()
method gives you sql query without bindings replaced. (see question marks below)
With this package you have getSql()
method. Which gives you same result with bindings replaced.
Requirement
Build History
Installation
Install via composer
Publish package config
Usage
After installing this package you can use these methods on eloquent and database builder.
-
getSql
- This method returns sql query.
- Optionally takes closure as parameter and calls closure with sql string.
- Returns string or closure result.
-
dumpSql
- This method prints sql query (uses dump() function)
- Returns builder.
logSql
- This method logs sql query.
- Optionally takes prefix string parameter. Which prepends to sql string.
- Log type can be set in config file (default is "info").
- Returns builder.
Examples
Eloquent
Database Builder
Replace bindings for all queries
Add code below into app/Providers/AppServiceProvider.php
file for listening all queries.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Semih ERDOGAN
- Dincer DEMIRCIOGLU
- All contributors
- The social image generated with banners.beyondco.de.
- This package generated using the melihovv/laravel-package-generator.
License
The MIT License (MIT). Please see License File for more information.