| @@ 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. |
|
| @@ 335-344 (lines=10) @@ | ||
| 332 | * |
|
| 333 | * @return $this |
|
| 334 | */ |
|
| 335 | public function using(array $values, $default = null) |
|
| 336 | { |
|
| 337 | return $this->display(function ($value) use ($values, $default) { |
|
| 338 | if (is_null($value)) { |
|
| 339 | return $default; |
|
| 340 | } |
|
| 341 | ||
| 342 | return array_get($values, $value, $default); |
|
| 343 | }); |
|
| 344 | } |
|
| 345 | ||
| 346 | /** |
|
| 347 | * Render this column with the given view. |
|