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

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