@@ 143-168 (lines=26) @@ | ||
140 | * |
|
141 | * @return array |
|
142 | */ |
|
143 | protected function formatValidationAttribute($input, $label, $column) |
|
144 | { |
|
145 | $new = $attributes = []; |
|
146 | ||
147 | if (is_array($column)) { |
|
148 | foreach ($column as $index => $col) { |
|
149 | $new[$col.$index] = $col; |
|
150 | } |
|
151 | } |
|
152 | ||
153 | foreach (array_keys(array_dot($input)) as $key) { |
|
154 | if (is_string($column)) { |
|
155 | if (Str::endsWith($key, ".$column")) { |
|
156 | $attributes[$key] = $label; |
|
157 | } |
|
158 | } else { |
|
159 | foreach ($new as $k => $val) { |
|
160 | if (Str::endsWith($key, ".$k")) { |
|
161 | $attributes[$key] = $label."[$val]"; |
|
162 | } |
|
163 | } |
|
164 | } |
|
165 | } |
|
166 | ||
167 | return $attributes; |
|
168 | } |
|
169 | ||
170 | /** |
|
171 | * Reset input key for validation. |
@@ 151-176 (lines=26) @@ | ||
148 | * |
|
149 | * @return array |
|
150 | */ |
|
151 | protected function formatValidationAttribute($input, $label, $column) |
|
152 | { |
|
153 | $new = $attributes = []; |
|
154 | ||
155 | if (is_array($column)) { |
|
156 | foreach ($column as $index => $col) { |
|
157 | $new[$col.$index] = $col; |
|
158 | } |
|
159 | } |
|
160 | ||
161 | foreach (array_keys(array_dot($input)) as $key) { |
|
162 | if (is_string($column)) { |
|
163 | if (Str::endsWith($key, ".$column")) { |
|
164 | $attributes[$key] = $label; |
|
165 | } |
|
166 | } else { |
|
167 | foreach ($new as $k => $val) { |
|
168 | if (Str::endsWith($key, ".$k")) { |
|
169 | $attributes[$key] = $label."[$val]"; |
|
170 | } |
|
171 | } |
|
172 | } |
|
173 | } |
|
174 | ||
175 | return $attributes; |
|
176 | } |
|
177 | ||
178 | /** |
|
179 | * Reset input key for validation. |