Skip to content

Commit

Permalink
Make code compatible with lumen.
Browse files Browse the repository at this point in the history
  • Loading branch information
muhdfaiz committed Nov 27, 2020
1 parent c149f47 commit 929036f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[![Total Downloads](https://poser.pugx.org/muhdfaiz/laravel-tail-db/downloads)](//packagist.org/packages/muhdfaiz/laravel-tail-db)
[![License](https://poser.pugx.org/muhdfaiz/laravel-tail-db/license)](//packagist.org/packages/muhdfaiz/laravel-tail-db)

A package to monitor, troubleshoot and optimize SQL query using console.
An artisan command to monitor, troubleshoot and optimize SQL query using console.

<img src="https://muhdfaiz.github.io/laravel-tail-db/assets/images/postgresql.png" width="600" alt="">
<img src="https://muhdfaiz.github.io/laravel-tail-db/assets/images/demo.gif" width="600" alt="">

## Features

Expand All @@ -21,6 +21,7 @@ A package to monitor, troubleshoot and optimize SQL query using console.

- PHP: ^7.0
- Laravel: ~5.5,~5.6,~5.7,~5.8,~6.0,~7.0,~8.0
- Lumen


## Installation
Expand All @@ -29,6 +30,12 @@ A package to monitor, troubleshoot and optimize SQL query using console.
composer require muhdfaiz/laravel-tail-db
```

## Publish Config File

```
php artisan vendor:publish --provider="Muhdfaiz\LaravelTailDb\TailDatabaseServiceProvider" --tag="tail-db-config"
```

## Usage

```
Expand All @@ -37,7 +44,7 @@ php artisan tail:db

## Documentation

For detail of installation instructions, in-depth usage, please take a look at the [official documentation](https://muhdfaiz.github.io/laravel-tail-db/).
For detail of installation instructions, in-depth usage, please take a look at the [documentation](https://muhdfaiz.github.io/laravel-tail-db/).

### Changelog

Expand Down
5 changes: 2 additions & 3 deletions src/DatabaseWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Muhdfaiz\LaravelTailDb;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Database\Events\QueryExecuted;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Request;
Expand All @@ -16,10 +15,10 @@ class DatabaseWatcher
/**
* Register the watcher.
*
* @param Application $app
* @param $app
* @return void
*/
public function register(Application $app)
public function register($app)
{
$app['events']->listen(QueryExecuted::class, [$this, 'recordQuery']);
}
Expand Down
12 changes: 5 additions & 7 deletions src/TailDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace Muhdfaiz\LaravelTailDb;

use Illuminate\Foundation\Application;

class TailDatabase
{
/**
* Register the database watchers and start the logging if enabled.
* Register the database watchers.
*
* @param Application $app
* @param $app
* @return void
*/
public static function start($app)
Expand All @@ -23,11 +21,11 @@ public static function start($app)

/**
* Register database watcher.
* Used this watcher to store database query.
* Used this watcher to listen for new SQL query executed in the application..
*
* @param Application $app
* @param $app
*/
protected static function registerDatabaseWatcher(Application $app)
protected static function registerDatabaseWatcher($app)
{
$databaseWatcher = $app->make(DatabaseWatcher::class);

Expand Down

0 comments on commit 929036f

Please sign in to comment.