Added encrypted custom field to seeder

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-10-26 07:41:25 +01:00
parent c4c47f2e8d
commit 9d887484c8
2 changed files with 20 additions and 2 deletions

View file

@ -88,7 +88,7 @@ class CustomFieldFactory extends Factory
return [
'name' => 'Test Encrypted',
'field_encrypted' => '1',
'help_text' => 'This is a test encrypted field.',
'help_text' => 'This is a sample encrypted field.',
];
});
}
@ -98,10 +98,20 @@ class CustomFieldFactory extends Factory
return $this->state(function () {
return [
'name' => 'Test Checkbox',
'help_text' => 'This is a test checkbox.',
'help_text' => 'This is a sample checkbox.',
'field_values' => "One\nTwo\nThree",
'element' => 'checkbox',
];
});
}
public function testRequired()
{
return $this->state(function () {
return [
'name' => 'Test Required',
'help_text' => 'This is a sample required field.',
];
});
}
}

View file

@ -35,6 +35,7 @@ class CustomFieldSeeder extends Seeder
CustomField::factory()->count(1)->macAddress()->create();
CustomField::factory()->count(1)->testEncrypted()->create();
CustomField::factory()->count(1)->testCheckbox()->create();
CustomField::factory()->count(1)->testRequired()->create();
DB::table('custom_field_custom_fieldset')->insert([
@ -96,6 +97,13 @@ class CustomFieldSeeder extends Seeder
'required' => 0,
],
[
'custom_field_id' => '8',
'custom_fieldset_id' => '1',
'order' => 0,
'required' => 1,
],
]);
}
}