mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Added encrypted custom field to seeder
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c4c47f2e8d
commit
9d887484c8
|
@ -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.',
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
],
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue