Code Duplication    Length = 12-12 lines in 2 locations

src/Show/Field.php 2 locations

@@ 300-311 (lines=12) @@
297
     *
298
     * @return Field
299
     */
300
    public function label($style = 'success')
301
    {
302
        return $this->unescape()->as(function ($value) use ($style) {
303
            if ($value instanceof Arrayable) {
304
                $value = $value->toArray();
305
            }
306
307
            return collect((array) $value)->map(function ($name) use ($style) {
308
                return "<span class='label label-{$style}'>$name</span>";
309
            })->implode('&nbsp;');
310
        });
311
    }
312
313
    /**
314
     * Show field as badges.
@@ 320-331 (lines=12) @@
317
     *
318
     * @return Field
319
     */
320
    public function badge($style = 'blue')
321
    {
322
        return $this->unescape()->as(function ($value) use ($style) {
323
            if ($value instanceof Arrayable) {
324
                $value = $value->toArray();
325
            }
326
327
            return collect((array) $value)->map(function ($name) use ($style) {
328
                return "<span class='badge bg-{$style}'>$name</span>";
329
            })->implode('&nbsp;');
330
        });
331
    }
332
333
    /**
334
     * Show field as json code.