Test Failed
Push — dev6 ( e3f62b...d58043 )
by Ron
17:13
created

AppSettingsServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 2
b 0
f 0
dl 0
loc 25
rs 10
ccs 6
cts 7
cp 0.8571

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 2 1
A register() 0 11 3
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\Facades\DB;
6
use Illuminate\Support\Facades\Schema;
7
use Illuminate\Support\ServiceProvider;
8
9
class AppSettingsServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register services.
13
     */
14 279
    public function register()
15
    {
16
        /*
17
        *   All App Settings that can be adjusted are stored in the database - retrieve them here and assign to the config
18
        */
19 279
        if(Schema::hasTable('app_settings'))
20
        {
21 279
            $settings = DB::table('app_settings')->get();
22 279
            foreach($settings as $setting)
23
            {
24
                config([$setting->key => $setting->value]);
25
            }
26
        }
27 279
    }
28
29
    /**
30
     * Bootstrap services.
31
     */
32 279
    public function boot()
33
    {
34
        //
35 279
    }
36
}
37