Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php namespace Modules\Dashboard\Foundation\Widgets; |
||
8 | public function boot() |
||
9 | { |
||
10 | $widgetViewComposer = app('Modules\Dashboard\Composers\WidgetViewComposer'); |
||
11 | /** @var \Illuminate\Contracts\View\Factory $view */ |
||
12 | $view = app('Illuminate\Contracts\View\Factory'); |
||
13 | |||
14 | if ($view->exists($this->view())) { |
||
15 | $html = $view->make($this->view()) |
||
16 | ->with($this->data()) |
||
17 | ->render(); |
||
18 | |||
19 | $sluggedName = str_slug($this->name()); |
||
20 | |||
21 | $widgetViewComposer |
||
22 | ->setWidgetName($sluggedName) |
||
23 | ->addSubView($sluggedName, $html) |
||
24 | ->addWidgetOptions($sluggedName, $this->options()); |
||
25 | } |
||
26 | } |
||
27 | |||
54 |