LikeServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 2 Features 0
Metric Value
eloc 1
c 3
b 2
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CSlant\LaravelLike\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LikeServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap services.
11
     */
12
    public function boot(): void
13
    {
14
        $this->registerAssetsPublishing();
15
    }
16
17
    /**
18
     * Register services.
19
     */
20
    public function register(): void
21
    {
22
        $this->registerConfigs();
23
    }
24
25
    /**
26
     * Get the services provided by the provider.
27
     *
28
     * @return null|array<string>
29
     */
30
    public function provides(): ?array
31
    {
32
        return ['like'];
33
    }
34
35
    /**
36
     * Register configs.
37
     */
38
    protected function registerConfigs(): void
39
    {
40
        $configPath = __DIR__.'/../../config/like.php';
41
        $this->mergeConfigFrom($configPath, 'like');
42
    }
43
44
    /**
45
     * Register assets publishing.
46
     */
47
    public function registerAssetsPublishing(): void
48
    {
49
        $configPath = __DIR__.'/../../config/like.php';
50
        $this->publishes([
51
            $configPath => config_path('like.php'),
52
        ], 'config');
53
54
        $this->publishes([
55
            __DIR__.'/../../migrations' => database_path('migrations'),
56
        ], 'migrations');
57
    }
58
}
59