blob: a05effe4b5a5f54a8e9431fe9a0eba11e0b3356a (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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');
    }
}
 |