Passed
Push — dev5 ( 861c43...4fe587 )
by Ron
07:07
created

SettingsServiceProvider::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
cc 1
eloc 0
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Providers;
4
5
use Config;
6
use Illuminate\Support\Facades\DB;
7
use Illuminate\Support\Facades\Schema;
8
use Illuminate\Support\ServiceProvider;
9
10
class SettingsServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Register services.
14
     *
15
     * @return void
16
     */
17 750
    public function register()
18
    {
19 750
        if(Schema::hasTable('settings'))
20
        {
21 750
            $settings = DB::table('settings')->get();
22 750
            foreach($settings as $setting)
23
            {
24
                Config([$setting->key => $setting->value]);
25
            }
26
        }
27 750
    }
28
29
    /**
30
     * Bootstrap services.
31
     *
32
     * @return void
33
     */
34 750
    public function boot()
35
    {
36
        //
37 750
    }
38
}
39