SettingComposer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use App\Repositories\SettingRepository;
6
use Illuminate\View\View;
7
8
class SettingComposer
9
{
10
    private $settings;
11
12
    public function __construct()
13
    {
14
        $this->settings = collect();
15
16
        $set_data = new SettingRepository();
17
        $this->settings = $set_data->getCacheSetting();
18
19
        // use App\Repositories\SettingRepository;
20
    // $set_data = new SettingRepository;
21
    // $settings = $set_data->getCacheSetting();
22
    }
23
24
    public function compose(View $view)
25
    {
26
        $view->with([
27
      'settings' => $this->settings,
28
    ]);
29
    }
30
}
31