Installation
Laravel
Require this package in the composer.json of your Laravel project. This will download the package
composer require muhdfaiz/laravel-tail-db
The Muhdfaiz\LaravelTailDb\TailDatabaseServiceProvider
is auto-discovered and registered by default.
Next, you need to publish the Laravel Tail DB configuration file:
php artisan vendor:publish --provider="Muhdfaiz\LaravelTailDb\TailDatabaseServiceProvider" --tag="tail-db-config"
Now you can start using it. Go to Usage section to start using it.
Lumen
Require this package in the composer.json of your Lumen project. This will download the package
composer require muhdfaiz/laravel-tail-db
Register service provider in bootstrap/app.php
. Don't forget to register Larasupport
service provider.
$app->register(Irazasyed\Larasupport\Providers\ArtisanServiceProvider::class);
$app->register(Muhdfaiz\LaravelTailDb\TailDatabaseServiceProvider::class);
Next, you need to publish the Laravel Tail DB configuration file:
php artisan vendor:publish --provider="Muhdfaiz\LaravelTailDb\TailDatabaseServiceProvider" --tag="tail-db-config"
Register the config file in bootstrap/app.php
$app->configure('laravel-tail-db');
Now you can start using it. Go to Usage section to start using it.
This is the default content of the config file that will be published as config/tail-db.php:
return [
'enabled' => env('TAIL_DB_ENABLED', true),
'host' => env('TAIL_DB_HOST', '0.0.0.0'),
'port' => env('TAIL_DB_PORT', '9001'),
'slow_duration' => env('TAIL_DB_SLOW_DURATION', 3000),
'ignore_query_keyword' => env('TAIL_DB_IGNORE_QUERY_KEYWORD', ''),
'log_query' => env('TAIL_DB_LOG_QUERY', false),
'filename' => env('TAIL_DB_FILENAME', 'database.log'),
'path' => env('TAIL_DB_PATH', storage_path('logs')),
'show_explain' => env('TAIL_DB_SHOW_EXPLAIN', true),
];