diff options
Diffstat (limited to 'src/SvgServiceProvider.php')
-rw-r--r-- | src/SvgServiceProvider.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/SvgServiceProvider.php b/src/SvgServiceProvider.php new file mode 100644 index 0000000..a05effe --- /dev/null +++ b/src/SvgServiceProvider.php @@ -0,0 +1,39 @@ +<?php + +namespace Lightscale\LaralightSvg; + +use Lightscale\LaralightSvg\Http\Controllers\SvgController; + +use Illuminate\Foundation\Console\AboutCommand; +use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Route; + +class SvgServiceProvider extends ServiceProvider +{ + const NAMESPACE = 'laralight-svg'; + const ROOT_PATH = __DIR__ . '../'; + + public $singletons = [ + SvgService::class, + ]; + + public function boot() + { + AboutCommand::add('Laralight SVG', fn() => [ + 'Version' => 'dev' + ]); + + $this->mergeConfigFrom(static::ROOT_PATH . '/config/svg.php', 'svg'); + $this->loadViewsFrom(Service::ROOT_PATH . '/resources/views', static::NAMESPACE); + + $this->publishes([ + static::ROOT_PATH . '/config/svg.php' => config_path('svg.php'), + ], static::NAMESPACE . '-config'); + + Route::get($this->app['config']->get('svg.svg_route'), [SvgController::class, 'serveSvg']) + ->name('laralight-svg.serve-svg'); + + + } + +} |