@@ -178,19 +178,15 @@ protected function getParameters($routeData, $routeAction, $bindings)
178178 protected function simplifyRules ($ rules )
179179 {
180180 // this will split all string rules into arrays of strings
181- $ rules = Validator::make ([], $ rules )->getRules ();
182-
183- if (count ($ rules ) === 0 ) {
184- return $ rules ;
185- }
181+ $ newRules = Validator::make ([], $ rules )->getRules ();
186182
187183 // Laravel will ignore the nested array rules unless the key referenced exists and is an array
188- // So we'll to create an empty array for each array attribute
189- $ values = collect ($ rules )
184+ // So we'll create an empty array for each array attribute
185+ $ values = collect ($ newRules )
190186 ->filter (function ($ values ) {
191187 return in_array ('array ' , $ values );
192188 })->map (function ($ val , $ key ) {
193- return ['' ];
189+ return [str_random () ];
194190 })->all ();
195191
196192 // Now this will return the complete ruleset.
@@ -371,6 +367,7 @@ protected function splitValuePairs($parameters, $first = 'is ', $last = 'or ')
371367 */
372368 protected function parseRule ($ rule , $ attribute , &$ attributeData , $ seed , $ routeData )
373369 {
370+ if (starts_with ($ attribute , 'array. ' )) { dd (array_keys ($ routeData )); }
374371 $ faker = Factory::create ();
375372 $ faker ->seed (crc32 ($ seed ));
376373
@@ -532,8 +529,9 @@ protected function parseRule($rule, $attribute, &$attributeData, $seed, $routeDa
532529 $ attributeData ['type ' ] = $ rule ;
533530 break ;
534531 case 'array ' :
535- $ attributeData ['value ' ] = $ faker ->word ;
532+ $ attributeData ['value ' ] = [ $ faker ->word ] ;
536533 $ attributeData ['type ' ] = $ rule ;
534+ $ attributeData ['description ' ][] = Description::parse ($ rule )->getDescription ();
537535 break ;
538536 case 'date ' :
539537 $ attributeData ['value ' ] = $ faker ->date ();
0 commit comments