Skip to content

Commit 3fbdf08

Browse files
author
Andrey Helldar
authored
Merge pull request #1 from TheDragonCode/1.x
Configuration file renamed to `http-logger`
2 parents 5ca42b9 + 99568d8 commit 3fbdf08

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ Run the migrations and submit a request to the site.
3333

3434
By default, the plugin is ready to go.
3535

36-
If you need to change the database connection or table name, you can do it in the [settings](config/logging.php).
37-
38-
Since Laravel contains a logging file by default, it will not be published, so manually copy the [settings](config/logging.php) block into your project's `config/logging.php` file.
36+
If you need to change the database connection or table name, you can do it in the [settings](config/http-logger.php).
3937

4038
### Database table
4139

config/http-logger.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
return [
4+
'enabled' => env('LOG_HTTP_ENABLED', true),
5+
6+
'connection' => env('DB_CONNECTION'),
7+
8+
'table' => 'http_logs',
9+
];

config/logging.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Concerns/HasTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ trait HasTable
88
{
99
protected function getLogsConnectionName(): ?string
1010
{
11-
return config('logging.http.connection');
11+
return config('http-logger.connection');
1212
}
1313

1414
protected function getLogsTableName(): ?string
1515
{
16-
return config('logging.http.table');
16+
return config('http-logger.table');
1717
}
1818
}

src/Http/Middleware/HttpLogMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public function handle(Request $request, Closure $next)
2121

2222
protected function enabled(): bool
2323
{
24-
return config('logging.http.enabled', true);
24+
return config('http-logger.enabled', true);
2525
}
2626
}

src/Providers/ServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ protected function bootMigrations(): void
2727
protected function publishConfig(): void
2828
{
2929
$this->publishes([
30-
__DIR__ . '/../../config/logging.php' => config_path('logging.php'),
30+
__DIR__ . '/../../config/http-logger.php' => config_path('http-logger.php'),
3131
], 'config');
3232
}
3333

3434
protected function registerConfig(): void
3535
{
36-
$this->mergeConfigFrom(__DIR__ . '/../../config/logging.php', 'logging');
36+
$this->mergeConfigFrom(__DIR__ . '/../../config/http-logger.php', 'http-logger');
3737
}
3838
}

0 commit comments

Comments
 (0)