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

AppSettingsServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 0
c 2
b 0
f 0
dl 0
loc 2
rs 10
ccs 1
cts 1
cp 1
cc 1
nc 1
nop 0
crap 1
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