Uploaded From CV. Swandhana Server

This commit is contained in:
Duidev Software House
2025-01-27 08:16:55 +07:00
commit 6b3be42361
15186 changed files with 2328862 additions and 0 deletions
@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
namespace Arcanedev\LogViewer\Providers;
use Arcanedev\LogViewer\Http\Routes\LogViewerRoute;
use Arcanedev\Support\Providers\RouteServiceProvider as ServiceProvider;
/**
* Class RouteServiceProvider
*
* @author ARCANEDEV <[email protected]>
*/
class RouteServiceProvider extends ServiceProvider
{
/* -----------------------------------------------------------------
| Getters & Setters
| -----------------------------------------------------------------
*/
/**
* Check if routes is enabled
*
* @return bool
*/
public function isEnabled(): bool
{
return (bool) $this->config('enabled', false);
}
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
/**
* Boot the service provider.
*/
public function boot(): void
{
if ($this->isEnabled()) {
$this->routes(function () {
static::mapRouteClasses([LogViewerRoute::class]);
});
}
}
/* -----------------------------------------------------------------
| Other Methods
| -----------------------------------------------------------------
*/
/**
* Get config value by key
*
* @param string $key
* @param mixed|null $default
*
* @return mixed
*/
private function config($key, $default = null)
{
return $this->app['config']->get("log-viewer.route.$key", $default);
}
}