Skip to content

Commit 7da107a

Browse files
committed
wip
1 parent 4e993cb commit 7da107a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
],
3232
"require": {
3333
"php": "^7.3|^8.0|^8.1|^8.2",
34-
"laravel/framework": "^8.12|^9.0|^10.0|^11.0"
34+
"laravel/framework": "^8.0|^9.0|^10.0|^11.0"
3535
},
3636
"autoload": {
3737
"psr-4": {

src/providers/ResponseBuilderServiceProvider.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ public function register()
1414

1515
public function boot()
1616
{
17-
$this->publishes([
18-
__DIR__.'/../config/config.php' => config_path('laravel-api-response-builder.php'),
19-
], 'laravel-api-response-config');
17+
if ($this->app->runningInConsole()) {
18+
$this->publishes([
19+
__DIR__.'/../config/config.php' => config_path('responseBuilder.php'),
20+
], 'config');
21+
}
2022

2123
$this->configureLogging();
2224
}
@@ -27,7 +29,11 @@ protected function configureLogging()
2729
$logFiles = $config['log_files'];
2830

2931
foreach ($logFiles as $level => $path) {
30-
$this->app['config']->set("logging.channels.{$level}_log", [
32+
if (!in_array($level, ['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'])) {
33+
throw new \InvalidArgumentException("Invalid logging level: {$level}");
34+
}
35+
36+
$this->app['config']->set("logging.channels.responsebuilder_{$level}", [
3137
'driver' => 'single',
3238
'path' => $path,
3339
'level' => $level,

0 commit comments

Comments
 (0)