@@ 192-201 (lines=10) @@ | ||
189 | * |
|
190 | * @return $this |
|
191 | */ |
|
192 | public function using(array $values, $default = null) |
|
193 | { |
|
194 | return $this->as(function ($value) use ($values, $default) { |
|
195 | if (is_null($value)) { |
|
196 | return $default; |
|
197 | } |
|
198 | ||
199 | return Arr::get($values, $value, $default); |
|
200 | }); |
|
201 | } |
|
202 | ||
203 | /** |
|
204 | * Show field as a image. |
@@ 428-437 (lines=10) @@ | ||
425 | * |
|
426 | * @return $this |
|
427 | */ |
|
428 | public function using(array $values, $default = null) |
|
429 | { |
|
430 | return $this->display(function ($value) use ($values, $default) { |
|
431 | if (is_null($value)) { |
|
432 | return $default; |
|
433 | } |
|
434 | ||
435 | return Arr::get($values, $value, $default); |
|
436 | }); |
|
437 | } |
|
438 | ||
439 | /** |
|
440 | * Render this column with the given view. |