Skip to content

Commit

Permalink
Fix service configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
CloudMyn committed Oct 20, 2023
1 parent ebe0d50 commit 756b2e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/LoggerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,18 @@ public function register()

protected function registerRoutes(): void
{
Route::middleware($this->routeConfiguration()[1])->group($this->routeConfiguration()[0], function () {
Route::middleware($this->routeConfiguration('middleware'))->group($this->routeConfiguration('prefix'), function () {
$this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
});
}

protected function routeConfiguration(): array
protected function routeConfiguration($key)
{
return [
$config = [
'prefix' => config('logger.previx', ''),
'middleware' => config('logger.middleware', []),
];

return $config[$key];
}
}

0 comments on commit 756b2e1

Please sign in to comment.