Code Duplication    Length = 10-10 lines in 2 locations

src/Show/Field.php 1 location

@@ 180-189 (lines=10) @@
177
     *
178
     * @return $this
179
     */
180
    public function using(array $values, $default = null)
181
    {
182
        return $this->as(function ($value) use ($values, $default) {
183
            if (is_null($value)) {
184
                return $default;
185
            }
186
187
            return array_get($values, $value, $default);
188
        });
189
    }
190
191
    /**
192
     * Show field as a image.

src/Grid/Column.php 1 location

@@ 346-355 (lines=10) @@
343
     *
344
     * @return $this
345
     */
346
    public function using(array $values, $default = null)
347
    {
348
        return $this->display(function ($value) use ($values, $default) {
349
            if (is_null($value)) {
350
                return $default;
351
            }
352
353
            return array_get($values, $value, $default);
354
        });
355
    }
356
357
    /**
358
     * Render this column with the given view.