123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Database\Factories;
- use Illuminate\Database\Eloquent\Factories\Factory;
- /**
- * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CustomField>
- */
- class CustomFieldFactory extends Factory
- {
- /**
- * Define the model's default state.
- *
- * @return array<string, mixed>
- */
- public function definition(): array
- {
- return [
- 'group' => config("custom-field.groups")[array_rand(config("custom-field.groups"))],
- 'key' => fake()->name(),
- 'label' => [
- 'en' => 'en',
- 'zh' => '中文',
- ],
- 'type' => 3,
- 'options' => [
- "value" => fake()->name(),
- "lang" => [
- 'en' => 'en',
- 'zh' => '中文',
- ]
- ]
- ];
- }
- }
|