JsRoutesServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
ccs 7
cts 7
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Bmatovu\JsRoutes;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class JsRoutesServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14 1
    public function boot()
15
    {
16 1
        $this->publishes([
17 1
            __DIR__.'/../config/js-routes.php' => config_path('js-routes.php'),
18 1
        ], 'config');
19
20 1
        $this->publishes([
21 1
            __DIR__.'/../resources/js/router.js' => resource_path('js/router.js'),
22
        ], 'resources');
23 1
24
        $this->commands([
25
            Console\GenerateJsRoutesCommand::class,
26
        ]);
27
    }
28
29
    /**
30
     * Register the application services.
31
     *
32
     * @return void
33
     */
34
    public function register()
35
    {
36
        $this->mergeConfigFrom(__DIR__.'/../config/js-routes.php', 'js-routes');
37
    }
38
}
39