ARCANEDEV / LogViewer

:page_with_curl: Provides a log viewer for Laravel
MIT License
2.37k stars 335 forks source link

Custom Routes #361

Closed robov closed 4 years ago

robov commented 4 years ago

Awesome work, I am implementing your package again in my system and I want to use custom routes, however this is not completly possible because of the route is hardcoded:

protected $showRoute = 'log-viewer::logs.show';

Would you please consider adding it to the config, so this hardcoded value can be customized ?

arcanedev-maroc commented 4 years ago

You can disable the default routes and create your own if you want a custom routes/controller

Related: #83

robov commented 4 years ago

Yes I disabled the routes in the config, but then I got the error: Route not found : log-viewer::logs.show

robov commented 4 years ago

For anyone facing the same issues, just overwrite the exact namings of the routes

Route::prefix('developer/')
    ->namespace('\Arcanedev\LogViewer\Http\Controllers')
    ->group(function () {
        Route::get('/', 'LogViewerController@index')
            ->name('log-viewer::dashboard');

        Route::prefix('logs')
            ->name('log-viewer::logs.')
            ->group(function () {

                Route::get('/', 'LogViewerController@listLogs')
                    ->name('list');
                Route::delete('/delete', 'LogViewerController@delete')
                    ->name('delete');

                Route::get('/{date}', 'LogViewerController@show')
                    ->name('show');

                Route::get('/{date}/download', 'LogViewerController@download')
                    ->name('download');

                Route::get('/{date}/{level}', 'LogViewerController@showByLevel')
                    ->name('filter');

                Route::get('/{date}/{level}/search', 'LogViewerController@search')
                    ->name('search');
            });
    });