File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ public function __construct()
40
40
*/
41
41
public function handle ()
42
42
{
43
+ $ filename = config ('tail-db.filename ' );
44
+ $ path = config ('tail-db.path ' );
45
+
46
+ // Check file exist. If not exist create empty log file.
47
+ if (!file_exists ( $ path . '/ ' . $ filename )) {
48
+ file_put_contents ($ path . '/ ' . $ filename , '' );
49
+ }
50
+
43
51
// Show an error message if Laravel Tail DB not enabled.
44
52
if (!$ this ->checkStatusEnabled ()) {
45
53
$ this ->output ->writeln (PHP_EOL );
@@ -57,6 +65,10 @@ public function handle()
57
65
->setTty (false )
58
66
->setTimeout (null )
59
67
->run (function ($ type , $ logData ) {
68
+ if (!$ logData ) {
69
+ return ;
70
+ }
71
+
60
72
$ logData = $ this ->parseLogData ($ logData );
61
73
62
74
$ this ->outputQueryDetails ($ logData );
You can’t perform that action at this time.
0 commit comments