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

ConfigurationServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 28
rs 10
wmc 3
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 2
A register() 0 4 1
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