| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class SettingsServiceProvider extends ServiceProvider |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Register services. |
||
| 14 | * |
||
| 15 | * @return void |
||
| 16 | */ |
||
| 17 | 750 | public function register() |
|
| 18 | { |
||
| 19 | try |
||
| 20 | { |
||
| 21 | 750 | if(Schema::hasTable('settings')) |
|
| 22 | { |
||
| 23 | 750 | $settings = DB::table('settings')->get(); |
|
| 24 | 750 | foreach($settings as $setting) |
|
| 25 | { |
||
| 26 | Config([$setting->key => $setting->value]); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | } |
||
| 30 | catch(\Illuminate\Database\QueryException $e) |
||
| 31 | { |
||
| 32 | // TODO - do something on exception |
||
| 33 | } |
||
| 34 | 750 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Bootstrap services. |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | */ |
||
| 41 | 750 | public function boot() |
|
| 43 | // |
||
| 44 | 750 | } |
|
| 46 |