NotificationOptionsServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 2
A register() 0 17 1
1
<?php
2
3
namespace BRKFun\NotificationOptions;
4
5
use BRKFun\NotificationOptions\Controllers\NotificationController;
6
use Illuminate\Support\ServiceProvider;
7
8
class NotificationOptionsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        $this->loadMigrationsFrom(__DIR__ . '/../migrations');
16
        $this->loadRoutesFrom(__DIR__ . '/../routes/routes.php');
17
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes(
20
                [
21
                    __DIR__ . '/../config/config.php' => config_path('notification-options.php'),
22
                ], 'config');
23
24
        }
25
    }
26
27
    /**
28
     * Register the application services.
29
     */
30
    public function register()
31
    {
32
        // Automatically apply the package configuration
33
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'notification-options');
34
35
        $this->app->make(NotificationController::class);
36
37
        $this->publishes(
38
            [
39
                __DIR__ . '/../resources/views' => resource_path('views/vendor/notification-options'),
40
            ], 'views');
41
42
        // Register the main class to use with the facade
43
        $this->app->singleton('notification-options', function () {
44
            return new NotificationOptions;
45
        });
46
    }
47
}
48