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