diff --git a/src/Http/Routes/LogViewerRoute.php b/src/Http/Routes/LogViewerRoute.php index c33b27d0..0a1927a7 100644 --- a/src/Http/Routes/LogViewerRoute.php +++ b/src/Http/Routes/LogViewerRoute.php @@ -4,6 +4,7 @@ namespace Arcanedev\LogViewer\Http\Routes; +use Arcanedev\LogViewer\Http\Controllers\LogViewerController; use Arcanedev\Support\Routing\RouteRegistrar; /** @@ -26,14 +27,12 @@ class LogViewerRoute extends RouteRegistrar */ public function map(): void { - $attributes = array_merge(config('log-viewer.route.attributes', []), [ - 'namespace' => 'Arcanedev\\LogViewer\\Http\\Controllers', - ]); + $attributes = (array) config('log-viewer.route.attributes'); $this->group($attributes, function() { $this->name('log-viewer::')->group(function () { - // log-viewer::dashboard - $this->get('/', 'LogViewerController@index')->name('dashboard'); + $this->get('/', [LogViewerController::class, 'index']) + ->name('dashboard'); // log-viewer::dashboard $this->mapLogsRoutes(); }); @@ -46,23 +45,23 @@ public function map(): void private function mapLogsRoutes(): void { $this->prefix('logs')->name('logs.')->group(function() { - $this->get('/', 'LogViewerController@listLogs') + $this->get('/', [LogViewerController::class, 'listLogs']) ->name('list'); // log-viewer::logs.list - $this->delete('delete', 'LogViewerController@delete') + $this->delete('delete', [LogViewerController::class, 'delete']) ->name('delete'); // log-viewer::logs.delete $this->prefix('{date}')->group(function() { - $this->get('/', 'LogViewerController@show') + $this->get('/', [LogViewerController::class, 'show']) ->name('show'); // log-viewer::logs.show - $this->get('download', 'LogViewerController@download') + $this->get('download', [LogViewerController::class, 'download']) ->name('download'); // log-viewer::logs.download - $this->get('{level}', 'LogViewerController@showByLevel') + $this->get('{level}', [LogViewerController::class, 'showByLevel']) ->name('filter'); // log-viewer::logs.filter - $this->get('{level}/search', 'LogViewerController@search') + $this->get('{level}/search', [LogViewerController::class, 'search']) ->name('search'); // log-viewer::logs.search }); }); diff --git a/src/Providers/RouteServiceProvider.php b/src/Providers/RouteServiceProvider.php index 86d5b576..f6559137 100644 --- a/src/Providers/RouteServiceProvider.php +++ b/src/Providers/RouteServiceProvider.php @@ -23,9 +23,7 @@ class RouteServiceProvider extends ServiceProvider */ public function routeAttributes() { - return array_merge($this->config('attributes', []), [ - 'namespace' => 'Arcanedev\\LogViewer\\Http\\Controllers', - ]); + return (array) $this->config('attributes'); } /**