| @@ 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. |
|
| @@ 172-197 (lines=26) @@ | ||
| 169 | * |
|
| 170 | * @return array |
|
| 171 | */ |
|
| 172 | protected function formatValidationAttribute($input, $label, $column) |
|
| 173 | { |
|
| 174 | $new = $attributes = []; |
|
| 175 | ||
| 176 | if (is_array($column)) { |
|
| 177 | foreach ($column as $index => $col) { |
|
| 178 | $new[$col.$index] = $col; |
|
| 179 | } |
|
| 180 | } |
|
| 181 | ||
| 182 | foreach (array_keys(array_dot($input)) as $key) { |
|
| 183 | if (is_string($column)) { |
|
| 184 | if (Str::endsWith($key, ".$column")) { |
|
| 185 | $attributes[$key] = $label; |
|
| 186 | } |
|
| 187 | } else { |
|
| 188 | foreach ($new as $k => $val) { |
|
| 189 | if (Str::endsWith($key, ".$k")) { |
|
| 190 | $attributes[$key] = $label."[$val]"; |
|
| 191 | } |
|
| 192 | } |
|
| 193 | } |
|
| 194 | } |
|
| 195 | ||
| 196 | return $attributes; |
|
| 197 | } |
|
| 198 | ||
| 199 | /** |
|
| 200 | * Reset input key for validation. |
|