|
1 | 1 | [](https://packagist.org/packages/arrilot/laravel-widgets/) |
2 | | -[](https://packagist.org/packages/arrilot/laravel-widgets) |
3 | | -[](https://travis-ci.org/arrilot/laravel-widgets) |
4 | | -[](https://scrutinizer-ci.com/g/arrilot/laravel-widgets/) |
| 2 | +[](https://packagist.org/packages/arrilot/laravel-widgets) |
| 3 | +[](https://travis-ci.org/arrilot/laravel-widgets) |
| 4 | +[](https://scrutinizer-ci.com/g/arrilot/laravel-widgets/) |
5 | 5 |
|
6 | 6 | #Widgets for Laravel |
7 | 7 |
|
@@ -76,7 +76,7 @@ class RecentNews extends AbstractWidget |
76 | 76 | { |
77 | 77 | // |
78 | 78 |
|
79 | | - return view("widgets.recent_news", [ |
| 79 | + return view('widgets.recent_news', [ |
80 | 80 | 'config' => $this->config, |
81 | 81 | ]); |
82 | 82 | } |
@@ -153,14 +153,14 @@ In this case do the following: |
153 | 153 | 2) Add defaults like that instead: |
154 | 154 |
|
155 | 155 | ```php |
156 | | - public function __construct(array $config = []) |
157 | | - { |
158 | | - $this->addConfigDefaults([ |
159 | | - 'child_key' => 'bar' |
160 | | - ]); |
| 156 | +public function __construct(array $config = []) |
| 157 | +{ |
| 158 | + $this->addConfigDefaults([ |
| 159 | + 'child_key' => 'bar' |
| 160 | + ]); |
161 | 161 |
|
162 | | - parent::__construct($config); |
163 | | - } |
| 162 | + parent::__construct($config); |
| 163 | +} |
164 | 164 | ``` |
165 | 165 |
|
166 | 166 | ### Directly |
@@ -220,7 +220,7 @@ This can be customized by adding a `placeholder()` method to the widget class. |
220 | 220 | ```php |
221 | 221 | public function placeholder() |
222 | 222 | { |
223 | | - return "Loading..."; |
| 223 | + return 'Loading...'; |
224 | 224 | } |
225 | 225 | ``` |
226 | 226 |
|
@@ -255,19 +255,19 @@ Async and Reloadable widgets both require some DOM interaction so they wrap all |
255 | 255 | This container is defined by `AbstractWidget::container()` method and can be customized too. |
256 | 256 |
|
257 | 257 | ```php |
258 | | - /** |
259 | | - * Async and reloadable widgets are wrapped in container. |
260 | | - * You can customize it by overriding this method. |
261 | | - * |
262 | | - * @return array |
263 | | - */ |
264 | | - public function container() |
265 | | - { |
266 | | - return [ |
267 | | - 'element' => 'div', |
268 | | - 'attributes' => 'style="display:inline" class="arrilot-widget-container"', |
269 | | - ]; |
270 | | - } |
| 258 | +/** |
| 259 | + * Async and reloadable widgets are wrapped in container. |
| 260 | + * You can customize it by overriding this method. |
| 261 | + * |
| 262 | + * @return array |
| 263 | + */ |
| 264 | +public function container() |
| 265 | +{ |
| 266 | + return [ |
| 267 | + 'element' => 'div', |
| 268 | + 'attributes' => 'style="display:inline" class="arrilot-widget-container"', |
| 269 | + ]; |
| 270 | +} |
271 | 271 | ``` |
272 | 272 |
|
273 | 273 | > Note: Nested async or reloadable widgets are not supported. |
@@ -306,7 +306,7 @@ Widget::group('sidebar')->position(4)->addAsyncWidget('widgetName2', $config2); |
306 | 306 |
|
307 | 307 | // display them in a view in the correct order |
308 | 308 | @widgetGroup('sidebar') |
309 | | -//or |
| 309 | +// or |
310 | 310 | {{ Widget::group('sidebar')->display() }} |
311 | 311 | ``` |
312 | 312 |
|
|
0 commit comments