Completed
Push — master ( a3496d...130652 )
by Jeremy
15:26
created

BlogSettingsComposer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A compose() 0 7 1
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use App\Models\Theme;
6
use App\Services\BlogThemeServices;
7
use Illuminate\View\View;
8
9
class BlogSettingsComposer
10
{
11
    protected $theme;
12
13
    /**
14
     * Create a new instance.
15
     *
16
     * @return void
17
     */
18
    public function __construct()
19
    {
20
        $this->theme = BlogThemeServices::getBlogTheme();
21
    }
22
23
    /**
24
     * Bind data to the view.
25
     *
26
     * @param View $view
27
     *
28
     * @return void
29
     */
30
    public function compose(View $view)
31
    {
32
        $data = [
33
            'theme' => $this->theme,
34
        ];
35
36
        $view->with($data);
37
    }
38
}
39