JsRoutesServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 1
A register() 0 3 1
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