12
12
namespace Overtrue \LaravelQueryLogger ;
13
13
14
14
use Illuminate \Database \Events \QueryExecuted ;
15
- use Illuminate \Support \Facades \DB ;
16
15
use Illuminate \Support \Facades \Log ;
17
16
use Illuminate \Support \ServiceProvider as LaravelServiceProvider ;
18
17
@@ -23,13 +22,13 @@ class ServiceProvider extends LaravelServiceProvider
23
22
*/
24
23
public function boot ()
25
24
{
26
- if (!$ this ->app ['config ' ]->get ('logging.query.enabled ' , false )) {
25
+ if (! $ this ->app ['config ' ]->get ('logging.query.enabled ' , false )) {
27
26
return ;
28
27
}
29
28
30
29
$ trigger = $ this ->app ['config ' ]->get ('logging.query.trigger ' );
31
30
32
- if (!empty ($ trigger ) && !$ this ->requestHasTrigger ($ trigger )) {
31
+ if (! empty ($ trigger ) && ! $ this ->requestHasTrigger ($ trigger )) {
33
32
return ;
34
33
}
35
34
@@ -50,7 +49,7 @@ public function boot()
50
49
}
51
50
Log::channel (config ('logging.query.channel ' , config ('logging.default ' )))
52
51
->debug (sprintf ('[%s] [%s] %s | %s: %s ' , $ query ->connection ->getDatabaseName (), $ duration , $ realSql ,
53
- request ()->method (), request ()->getRequestUri ()));
52
+ request ()->method (), request ()->getRequestUri ()));
54
53
});
55
54
}
56
55
@@ -62,8 +61,7 @@ public function register()
62
61
}
63
62
64
63
/**
65
- * @param string $trigger
66
- *
64
+ * @param string $trigger
67
65
* @return bool
68
66
*/
69
67
public function requestHasTrigger ($ trigger )
@@ -75,7 +73,6 @@ public function requestHasTrigger($trigger)
75
73
* Format duration.
76
74
*
77
75
* @param float $seconds
78
- *
79
76
* @return string
80
77
*/
81
78
private function formatDuration ($ seconds )
0 commit comments