faker->unique()->company; $type = \collect(InputTypeEnum::toArray())->random(); $details = null; if ( \in_array($type, [ InputTypeEnum::selectMultiple, InputTypeEnum::select, InputTypeEnum::radio, InputTypeEnum::checkbox ]) ) { $details = $this->faker->words(\count($mandatoryLocales)); } return [ 'type' => $type, 'name' => $name, 'slug' => Str::of($name)->slug(), 'placeholder' => \collect($mandatoryLocales)->mapWithKeys(function ($locale) { return [$locale => "{$locale} {$this->faker->company}"]; })->all(), 'details' => !empty($details) ? \collect($details)->map(function ($word) use ($mandatoryLocales) { return \collect($mandatoryLocales)->mapWithKeys(function ($locale) use ($word) { return [$locale => "{$locale} {$word}"]; })->all(); })->all() : null, 'is_visible' => $this->faker->boolean(75), 'required' => $this->faker->boolean(75), 'status' => InputStatusEnum::default, 'tenant_id' => Tenant::query()->first('id'), ]; } }