| @@ 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. |
|
| @@ 469-478 (lines=10) @@ | ||
| 466 | * |
|
| 467 | * @return $this |
|
| 468 | */ |
|
| 469 | public function using(array $values, $default = null) |
|
| 470 | { |
|
| 471 | return $this->display(function ($value) use ($values, $default) { |
|
| 472 | if (is_null($value)) { |
|
| 473 | return $default; |
|
| 474 | } |
|
| 475 | ||
| 476 | return Arr::get($values, $value, $default); |
|
| 477 | }); |
|
| 478 | } |
|
| 479 | ||
| 480 | /** |
|
| 481 | * Replace output value with giving map. |
|