1212namespace Overtrue \LaravelQueryLogger ;
1313
1414use Illuminate \Database \Events \QueryExecuted ;
15- use Illuminate \Support \Facades \DB ;
1615use Illuminate \Support \Facades \Log ;
1716use Illuminate \Support \ServiceProvider as LaravelServiceProvider ;
1817
@@ -23,13 +22,13 @@ class ServiceProvider extends LaravelServiceProvider
2322 */
2423 public function boot ()
2524 {
26- if (!$ this ->app ['config ' ]->get ('logging.query.enabled ' , false )) {
25+ if (! $ this ->app ['config ' ]->get ('logging.query.enabled ' , false )) {
2726 return ;
2827 }
2928
3029 $ trigger = $ this ->app ['config ' ]->get ('logging.query.trigger ' );
3130
32- if (!empty ($ trigger ) && !$ this ->requestHasTrigger ($ trigger )) {
31+ if (! empty ($ trigger ) && ! $ this ->requestHasTrigger ($ trigger )) {
3332 return ;
3433 }
3534
@@ -50,7 +49,7 @@ public function boot()
5049 }
5150 Log::channel (config ('logging.query.channel ' , config ('logging.default ' )))
5251 ->debug (sprintf ('[%s] [%s] %s | %s: %s ' , $ query ->connection ->getDatabaseName (), $ duration , $ realSql ,
53- request ()->method (), request ()->getRequestUri ()));
52+ request ()->method (), request ()->getRequestUri ()));
5453 });
5554 }
5655
@@ -62,8 +61,7 @@ public function register()
6261 }
6362
6463 /**
65- * @param string $trigger
66- *
64+ * @param string $trigger
6765 * @return bool
6866 */
6967 public function requestHasTrigger ($ trigger )
@@ -75,7 +73,6 @@ public function requestHasTrigger($trigger)
7573 * Format duration.
7674 *
7775 * @param float $seconds
78- *
7976 * @return string
8077 */
8178 private function formatDuration ($ seconds )
0 commit comments