Added radio to seeder for custom fields
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
70250191ed
commit
4f56c2e9d6
2 changed files with 26 additions and 0 deletions
|
@ -105,4 +105,16 @@ class CustomFieldFactory extends Factory
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRadio()
|
||||||
|
{
|
||||||
|
return $this->state(function () {
|
||||||
|
return [
|
||||||
|
'name' => 'Test Radio',
|
||||||
|
'help_text' => 'This is a sample radio.',
|
||||||
|
'field_values' => "One\r\nTwo\r\nThree",
|
||||||
|
'element' => 'radio',
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ class CustomFieldSeeder extends Seeder
|
||||||
CustomField::factory()->count(1)->macAddress()->create();
|
CustomField::factory()->count(1)->macAddress()->create();
|
||||||
CustomField::factory()->count(1)->testEncrypted()->create();
|
CustomField::factory()->count(1)->testEncrypted()->create();
|
||||||
CustomField::factory()->count(1)->testCheckbox()->create();
|
CustomField::factory()->count(1)->testCheckbox()->create();
|
||||||
|
CustomField::factory()->count(1)->testRadio()->create();
|
||||||
|
|
||||||
|
|
||||||
DB::table('custom_field_custom_fieldset')->insert([
|
DB::table('custom_field_custom_fieldset')->insert([
|
||||||
|
@ -96,6 +97,19 @@ class CustomFieldSeeder extends Seeder
|
||||||
'required' => 0,
|
'required' => 0,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'custom_field_id' => '8',
|
||||||
|
'custom_fieldset_id' => '2',
|
||||||
|
'order' => 0,
|
||||||
|
'required' => 0,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'custom_field_id' => '8',
|
||||||
|
'custom_fieldset_id' => '1',
|
||||||
|
'order' => 0,
|
||||||
|
'required' => 0,
|
||||||
|
],
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue