@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return app($widget); |
60 | 60 | } |
61 | 61 | |
62 | - $widget = app()->getNamespace().'Widgets\\'.$widget; |
|
62 | + $widget = app()->getNamespace() . 'Widgets\\' . $widget; |
|
63 | 63 | |
64 | 64 | return app($widget); |
65 | 65 | } |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | private function generateHtml($widget, ...$args) |
76 | 76 | { |
77 | 77 | // Everything inside this function is executed only when the cache is not available. |
78 | - $expensivePhpCode = function () use ($widget, $args) { |
|
78 | + $expensivePhpCode = function() use ($widget, $args) { |
|
79 | 79 | $this->makeDataForView($widget, $args); |
80 | 80 | |
81 | 81 | return $this->renderTemplate($widget); |
82 | 82 | }; |
83 | 83 | |
84 | - if (! $widget->cacheView) { |
|
84 | + if (!$widget->cacheView) { |
|
85 | 85 | return $expensivePhpCode(); |
86 | 86 | } |
87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | private function makeDataForView($widget, array $args) |
99 | 99 | { |
100 | - $expensiveCode = function () use ($widget, $args) { |
|
100 | + $expensiveCode = function() use ($widget, $args) { |
|
101 | 101 | |
102 | 102 | // Here we call the data method on the widget class. |
103 | 103 | $viewData = \App::call($widget->controller, ...$args); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | private function printError($widget, \Exception $e): void |
154 | 154 | { |
155 | 155 | if (Str::contains($e->getMessage(), 'Undefined variable:')) { |
156 | - dump('You should use the "$'.$widget->contextAs.'" variable in your widget view to access controller data'); |
|
156 | + dump('You should use the "$' . $widget->contextAs . '" variable in your widget view to access controller data'); |
|
157 | 157 | } |
158 | 158 | dd($e); |
159 | 159 | } |