1 | <?php |
||
2 | |||
3 | namespace App\Http\ViewComposers; |
||
4 | |||
5 | use App\Services\ThemeServices; |
||
6 | use Illuminate\View\View; |
||
7 | |||
8 | class SettingsComposer |
||
9 | { |
||
10 | protected $theme; |
||
11 | |||
12 | /** |
||
13 | * Create a new instance. |
||
14 | * |
||
15 | * @return void |
||
16 | */ |
||
17 | public function __construct() |
||
18 | { |
||
19 | $this->theme = ThemeServices::getTheTheme(); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Bind data to the view. |
||
24 | * |
||
25 | * @param View $view |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | public function compose(View $view) |
||
30 | { |
||
31 | $theme = ThemeServices::checkForRandomTheme($this->theme); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
32 | |||
33 | $data = [ |
||
34 | 'theme' => $theme, |
||
35 | ]; |
||
36 | |||
37 | $view->with($data); |
||
38 | } |
||
39 | } |
||
40 |