Code Duplication    Length = 10-10 lines in 2 locations

src/Show/Field.php 1 location

@@ 193-202 (lines=10) @@
190
     *
191
     * @return $this
192
     */
193
    public function using(array $values, $default = null)
194
    {
195
        return $this->as(function ($value) use ($values, $default) {
196
            if (is_null($value)) {
197
                return $default;
198
            }
199
200
            return Arr::get($values, $value, $default);
201
        });
202
    }
203
204
    /**
205
     * Show field as a image.

src/Grid/Column.php 1 location

@@ 561-570 (lines=10) @@
558
     *
559
     * @return $this
560
     */
561
    public function using(array $values, $default = null)
562
    {
563
        return $this->display(function ($value) use ($values, $default) {
564
            if (is_null($value)) {
565
                return $default;
566
            }
567
568
            return Arr::get($values, $value, $default);
569
        });
570
    }
571
572
    /**
573
     * Replace output value with giving map.