Code Duplication    Length = 12-12 lines in 2 locations

src/Show/Field.php 2 locations

@@ 360-371 (lines=12) @@
357
     *
358
     * @return Field
359
     */
360
    public function label($style = 'success')
361
    {
362
        return $this->unescape()->as(function ($value) use ($style) {
363
            if ($value instanceof Arrayable) {
364
                $value = $value->toArray();
365
            }
366
367
            return collect((array) $value)->map(function ($name) use ($style) {
368
                return "<span class='label label-{$style}'>$name</span>";
369
            })->implode('&nbsp;');
370
        });
371
    }
372
373
    /**
374
     * Show field as badges.
@@ 380-391 (lines=12) @@
377
     *
378
     * @return Field
379
     */
380
    public function badge($style = 'blue')
381
    {
382
        return $this->unescape()->as(function ($value) use ($style) {
383
            if ($value instanceof Arrayable) {
384
                $value = $value->toArray();
385
            }
386
387
            return collect((array) $value)->map(function ($name) use ($style) {
388
                return "<span class='badge bg-{$style}'>$name</span>";
389
            })->implode('&nbsp;');
390
        });
391
    }
392
393
    /**
394
     * Show field as json code.