@@ 193-202 (lines=10) @@ | ||
190 | * |
|
191 | * @return $this |
|
192 | */ |
|
193 | public function using(array $values, $default = null) |
|
194 | { |
|
195 | return $this->as(function ($value) use ($values, $default) { |
|
196 | if (is_null($value)) { |
|
197 | return $default; |
|
198 | } |
|
199 | ||
200 | return Arr::get($values, $value, $default); |
|
201 | }); |
|
202 | } |
|
203 | ||
204 | /** |
|
205 | * Show field as a image. |
@@ 123-132 (lines=10) @@ | ||
120 | * |
|
121 | * @return $this |
|
122 | */ |
|
123 | public function using(array $values, $default = null) |
|
124 | { |
|
125 | return $this->display(function ($value) use ($values, $default) { |
|
126 | if (is_null($value)) { |
|
127 | return $default; |
|
128 | } |
|
129 | ||
130 | return Arr::get($values, $value, $default); |
|
131 | }); |
|
132 | } |
|
133 | ||
134 | /** |
|
135 | * Replace output value with giving map. |