ServiceProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 11
c 3
b 0
f 0
dl 0
loc 29
ccs 0
cts 13
cp 0
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configureExportResource() 0 4 1
A boot() 0 13 3
A register() 0 3 1
1
<?php
2
3
namespace NovaExportConfiguration;
4
5
use NovaExportConfiguration\Nova\Resources\ExportConfiguration;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9
    public function boot(): void
10
    {
11
        if ($this->app->runningInConsole()) {
12
            if (NovaExportConfig::$runsMigrations) {
13
                $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
14
            }
15
16
            $this->publishes([
17
                __DIR__ . '/../config/nova-export-configuration.php' => config_path('nova-export-configuration.php'),
18
            ], 'config');
19
        }
20
21
        $this->configureExportResource();
22
    }
23
24
    /**
25
     * @inheritDoc
26
     */
27
    public function register()
28
    {
29
        $this->mergeConfigFrom(__DIR__ . '/../config/nova-export-configuration.php', 'nova-export-configuration');
30
    }
31
32
    public function configureExportResource(): void
33
    {
34
        ExportConfiguration::$model = NovaExportConfig::$configurationModelClass;
35
        ExportConfiguration::$group = __('Export');
36
    }
37
}
38