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