| @@ 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. |
|
| @@ 417-426 (lines=10) @@ | ||
| 414 | * |
|
| 415 | * @return $this |
|
| 416 | */ |
|
| 417 | public function using(array $values, $default = null) |
|
| 418 | { |
|
| 419 | return $this->display(function ($value) use ($values, $default) { |
|
| 420 | if (is_null($value)) { |
|
| 421 | return $default; |
|
| 422 | } |
|
| 423 | ||
| 424 | return Arr::get($values, $value, $default); |
|
| 425 | }); |
|
| 426 | } |
|
| 427 | ||
| 428 | /** |
|
| 429 | * Render this column with the given view. |
|