@@ 313-322 (lines=10) @@ | ||
310 | * |
|
311 | * @return $this |
|
312 | */ |
|
313 | public function using(array $values, $default = null) |
|
314 | { |
|
315 | return $this->display(function ($value) use ($values, $default) { |
|
316 | if (is_null($value)) { |
|
317 | return $default; |
|
318 | } |
|
319 | ||
320 | return array_get($values, $value, $default); |
|
321 | }); |
|
322 | } |
|
323 | ||
324 | /** |
|
325 | * If has display callbacks. |
@@ 173-182 (lines=10) @@ | ||
170 | * |
|
171 | * @return $this |
|
172 | */ |
|
173 | public function using(array $values, $default = null) |
|
174 | { |
|
175 | return $this->as(function ($value) use ($values, $default) { |
|
176 | if (is_null($value)) { |
|
177 | return $default; |
|
178 | } |
|
179 | ||
180 | return array_get($values, $value, $default); |
|
181 | }); |
|
182 | } |
|
183 | ||
184 | /** |
|
185 | * Show field as a image. |