@@ 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. |
@@ 151-160 (lines=10) @@ | ||
148 | * |
|
149 | * @return $this |
|
150 | */ |
|
151 | public function using(array $values, $default = null) |
|
152 | { |
|
153 | return $this->as(function ($value) use ($values, $default) { |
|
154 | if (is_null($value)) { |
|
155 | return $default; |
|
156 | } |
|
157 | ||
158 | return array_get($values, $value, $default); |
|
159 | }); |
|
160 | } |
|
161 | ||
162 | /** |
|
163 | * Show field as a image. |