Skip to content

A free open source IT asset/license management system

Added two more custom fields/fieldsets to seeder

snipe3717d6017064
diff --git a/database/factories/CustomFieldFactory.php b/database/factories/CustomFieldFactory.php
index 937c66fb0b..53f23a205f 100644
--- a/database/factories/CustomFieldFactory.php
+++ b/database/factories/CustomFieldFactory.php
@@ -81,4 +81,26 @@ class CustomFieldFactory extends Factory
];
});
}
+
+ public function testEncrypted()
+ {
+ return $this->state(function () {
+ return [
+ 'name' => 'Test Encrypted',
+ 'help_text' => 'This is a test encrypted field.',
+ ];
+ });
+ }
+
+ public function testCheckbox()
+ {
+ return $this->state(function () {
+ return [
+ 'name' => 'Test Checkbox',
+ 'help_text' => 'This is a test checkbox.',
+ 'field_values' => "One\nTwo\nThree",
+ 'element' => 'checkbox',
+ ];
+ });
+ }
}
diff --git a/database/seeders/CustomFieldSeeder.php b/database/seeders/CustomFieldSeeder.php
index 551e05f40f..e51ca510f9 100644
--- a/database/seeders/CustomFieldSeeder.php
+++ b/database/seeders/CustomFieldSeeder.php
@@ -33,6 +33,9 @@ class CustomFieldSeeder extends Seeder
CustomField::factory()->count(1)->ram()->create();
CustomField::factory()->count(1)->cpu()->create();
CustomField::factory()->count(1)->macAddress()->create();
+ CustomField::factory()->count(1)->testEncrypted()->create();
+ CustomField::factory()->count(1)->testCheckbox()->create();
+
DB::table('custom_field_custom_fieldset')->insert([
[
@@ -66,6 +69,33 @@ class CustomFieldSeeder extends Seeder
'required' => 0,
],
+ [
+ 'custom_field_id' => '6',
+ 'custom_fieldset_id' => '2',
+ 'order' => 0,
+ 'required' => 0,
+ ],
+
+ [
+ 'custom_field_id' => '6',
+ 'custom_fieldset_id' => '1',
+ 'order' => 0,
+ 'required' => 0,
+ ],
+
+ [
+ 'custom_field_id' => '7',
+ 'custom_fieldset_id' => '2',
+ 'order' => 0,
+ 'required' => 0,
+ ],
+ [
+ 'custom_field_id' => '7',
+ 'custom_fieldset_id' => '1',
+ 'order' => 0,
+ 'required' => 0,
+ ],
+
]);
}
}