Completed
Push — master ( a19a47...15bbc5 )
by Arjay
15:59
created

ConfigurationServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 10
rs 9.4285
1
<?php
2
3
namespace Yajra\CMS\Providers;
4
5
use Yajra\CMS\Entities\Configuration;
6
use Illuminate\Database\QueryException;
7
use Illuminate\Support\ServiceProvider;
8
9
class ConfigurationServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        try {
19
            Configuration::all()->each(function($config) {
20
                config()->set($config->key, $config->value);
21
            });
22
        } catch (QueryException $e) {
23
            // \\_(",)_//
24
        }
25
    }
26
27
    /**
28
     * Register the application services.
29
     *
30
     * @return void
31
     */
32
    public function register()
33
    {
34
        //
35
    }
36
}
37