mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Added two more custom fields/fieldsets to seeder
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
6c996ac8fa
commit
3717d60170
|
@ -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',
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,9 @@ class CustomFieldSeeder extends Seeder
|
||||||
CustomField::factory()->count(1)->ram()->create();
|
CustomField::factory()->count(1)->ram()->create();
|
||||||
CustomField::factory()->count(1)->cpu()->create();
|
CustomField::factory()->count(1)->cpu()->create();
|
||||||
CustomField::factory()->count(1)->macAddress()->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([
|
DB::table('custom_field_custom_fieldset')->insert([
|
||||||
[
|
[
|
||||||
|
@ -66,6 +69,33 @@ class CustomFieldSeeder extends Seeder
|
||||||
'required' => 0,
|
'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,
|
||||||
|
],
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue