1
1
![ Social Image] ( social.jpeg )
2
2
3
3
[ ![ GitHub Workflow Status] ( https://github.com/laratoolbox/query-viewer/workflows/Run%20tests/badge.svg )] ( https://github.com/laratoolbox/query-viewer/actions )
4
-
5
4
[ ![ Packagist] ( https://img.shields.io/packagist/v/laratoolbox/query-viewer.svg )] ( https://packagist.org/packages/laratoolbox/query-viewer )
6
- [ ![ Packagist] ( https://poser.pugx.org/laratoolbox/query-viewer/d/total.svg )] ( https://packagist.org/packages/laratoolbox/query-viewer )
7
5
[ ![ Packagist] ( https://img.shields.io/packagist/l/laratoolbox/query-viewer.svg )] ( https://packagist.org/packages/laratoolbox/query-viewer )
6
+ [ ![ GitHub issues] ( https://img.shields.io/github/issues/laratoolbox/query-viewer.svg )] ( https://github.com/laratoolbox/query-viewer/issues )
8
7
9
8
This package adds methods for getting sql query to eloquent and database query builder.
10
9
@@ -57,10 +56,10 @@ User::select('name')->where('id', 5)->getSql();
57
56
User::select('name')
58
57
->where('id', 5)
59
58
->dumpSql()
59
+ ->logSql('LOG_PREFIX_HERE') // logs sql to log file. (LOG_PREFIX_HERE : select `name` from `users` where `id` = 5)
60
60
->where('name', '!=', 'john')
61
61
->dumpSql()
62
62
->where('surname', '!=', 'doe')
63
- ->logSql('SURNAME_QUERY') // logs sql to log file.
64
63
->where('email', 'LIKE', '%example%')
65
64
->getSqlFunc(function(string $sql) {
66
65
echo $sql;
@@ -81,10 +80,10 @@ User::select('name')
81
80
\DB::table('users')
82
81
->where('id', 5)
83
82
->dumpSql()
83
+ ->logSql('LOG_PREFIX_HERE') // logs sql to log file. (LOG_PREFIX_HERE : select `name` from `users` where `id` = 5)
84
84
->where('name', '!=', 'john')
85
85
->dumpSql()
86
86
->where('surname', '!=', 'doe')
87
- ->logSql('SURNAME_QUERY') // logs sql to log file.
88
87
->where('email', 'LIKE', '%example%')
89
88
->getSqlFunc(function(string $sql) {
90
89
echo $sql;
0 commit comments