TranslatableServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Dimsav\Translatable;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class TranslatableServiceProvider extends ServiceProvider
8
{
9
    public function boot()
10
    {
11
        $this->publishes([
12
            __DIR__.'/../config/translatable.php' => config_path('translatable.php'),
13
        ], 'translatable');
14
    }
15
16
    public function register()
17
    {
18
        $this->mergeConfigFrom(
19
            __DIR__.'/../config/translatable.php', 'translatable'
20
        );
21
22
        $this->registerTranslatableHelper();
23
    }
24
25
    public function registerTranslatableHelper()
26
    {
27
        $this->app->singleton('translatable.locales', Locales::class);
28
        $this->app->singleton(Locales::class);
29
    }
30
31
    public function provides()
32
    {
33
        return [
34
            'translatable.helper',
35
            Locales::class,
36
        ];
37
    }
38
}
39