diff --git a/database/factories/CustomFieldFactory.php b/database/factories/CustomFieldFactory.php index 142adacdcf..7cbc2210c9 100644 --- a/database/factories/CustomFieldFactory.php +++ b/database/factories/CustomFieldFactory.php @@ -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.', + ]; + }); + } } diff --git a/database/seeders/CustomFieldSeeder.php b/database/seeders/CustomFieldSeeder.php index e51ca510f9..5d8d44e4b8 100644 --- a/database/seeders/CustomFieldSeeder.php +++ b/database/seeders/CustomFieldSeeder.php @@ -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, + ], + ]); } }