Completed
Pull Request — master (#3798)
by
unknown
02:44
created
src/Show/Field.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function using(array $values, $default = null)
194 194
     {
195
-        return $this->as(function ($value) use ($values, $default) {
195
+        return $this->as(function($value) use ($values, $default) {
196 196
             if (is_null($value)) {
197 197
                 return $default;
198 198
             }
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function image($server = '', $width = 200, $height = 200, $is_zoom = false)
214 214
     {
215
-        if ($is_zoom){
215
+        if ($is_zoom) {
216 216
             Admin::css('/vendor/laravel-admin/image-zoom/zoom.css');
217 217
             Admin::js('/vendor/laravel-admin/image-zoom/zoom.js');
218 218
         }
219
-        return $this->unescape()->as(function ($images) use ($server, $width, $height, $is_zoom) {
220
-            return collect($images)->map(function ($path) use ($server, $width, $height, $is_zoom) {
219
+        return $this->unescape()->as(function($images) use ($server, $width, $height, $is_zoom) {
220
+            return collect($images)->map(function($path) use ($server, $width, $height, $is_zoom) {
221 221
                 if (empty($path)) {
222 222
                     return '';
223 223
                 }
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
      */
253 253
     public function carousel($width = 300, $height = 200, $server = '')
254 254
     {
255
-        return $this->unescape()->as(function ($images) use ($server, $width, $height) {
256
-            $items = collect($images)->map(function ($path) use ($server, $width, $height) {
255
+        return $this->unescape()->as(function($images) use ($server, $width, $height) {
256
+            $items = collect($images)->map(function($path) use ($server, $width, $height) {
257 257
                 if (empty($path)) {
258 258
                     return '';
259 259
                 }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     {
294 294
         $field = $this;
295 295
 
296
-        return $this->unescape()->as(function ($path) use ($server, $download, $field) {
296
+        return $this->unescape()->as(function($path) use ($server, $download, $field) {
297 297
             $name = basename($path);
298 298
 
299 299
             $field->border = false;
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      */
348 348
     public function link($href = '', $target = '_blank')
349 349
     {
350
-        return $this->unescape()->as(function ($link) use ($href, $target) {
350
+        return $this->unescape()->as(function($link) use ($href, $target) {
351 351
             $href = $href ?: $link;
352 352
 
353 353
             return "<a href='$href' target='{$target}'>{$link}</a>";
@@ -363,12 +363,12 @@  discard block
 block discarded – undo
363 363
      */
364 364
     public function label($style = 'success')
365 365
     {
366
-        return $this->unescape()->as(function ($value) use ($style) {
366
+        return $this->unescape()->as(function($value) use ($style) {
367 367
             if ($value instanceof Arrayable) {
368 368
                 $value = $value->toArray();
369 369
             }
370 370
 
371
-            return collect((array) $value)->map(function ($name) use ($style) {
371
+            return collect((array) $value)->map(function($name) use ($style) {
372 372
                 return "<span class='label label-{$style}'>$name</span>";
373 373
             })->implode('&nbsp;');
374 374
         });
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
      */
384 384
     public function badge($style = 'blue')
385 385
     {
386
-        return $this->unescape()->as(function ($value) use ($style) {
386
+        return $this->unescape()->as(function($value) use ($style) {
387 387
             if ($value instanceof Arrayable) {
388 388
                 $value = $value->toArray();
389 389
             }
390 390
 
391
-            return collect((array) $value)->map(function ($name) use ($style) {
391
+            return collect((array) $value)->map(function($name) use ($style) {
392 392
                 return "<span class='badge bg-{$style}'>$name</span>";
393 393
             })->implode('&nbsp;');
394 394
         });
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     {
404 404
         $field = $this;
405 405
 
406
-        return $this->unescape()->as(function ($value) use ($field) {
406
+        return $this->unescape()->as(function($value) use ($field) {
407 407
             $content = json_decode($value, true);
408 408
 
409 409
             if (json_last_error() == 0) {
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
      */
424 424
     public function filesize()
425 425
     {
426
-        return $this->as(function ($value) {
426
+        return $this->as(function($value) {
427 427
             return file_size($value);
428 428
         });
429 429
     }
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 
563 563
         $field = $this;
564 564
 
565
-        return $this->as(function ($value) use ($extend, $field, $arguments) {
565
+        return $this->as(function($value) use ($extend, $field, $arguments) {
566 566
             if (!$extend->border) {
567 567
                 $field->border = false;
568 568
             }
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
     public function render()
622 622
     {
623 623
         if ($this->showAs->isNotEmpty()) {
624
-            $this->showAs->each(function ($callable) {
624
+            $this->showAs->each(function($callable) {
625 625
                 $this->value = $callable->call(
626 626
                     $this->parent->getModel(),
627 627
                     $this->value
Please login to merge, or discard this patch.