mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Remove unneeded fields in factory state
This commit is contained in:
parent
ab561d1ce8
commit
c6d9da1571
|
@ -436,18 +436,6 @@ class AssetModelFactory extends Factory
|
||||||
return $this->state(function () {
|
return $this->state(function () {
|
||||||
$field = CustomField::factory()->testEncrypted()->create(); // TODO - having to create and then 'find' the thing you just created is WEIRD
|
$field = CustomField::factory()->testEncrypted()->create(); // TODO - having to create and then 'find' the thing you just created is WEIRD
|
||||||
return [
|
return [
|
||||||
'name' => 'asset with encrypted field',
|
|
||||||
'category_id' => function () {
|
|
||||||
return Category::where('name', 'Mobile Phones')->first() ?? Category::factory()->assetMobileCategory();
|
|
||||||
},
|
|
||||||
'manufacturer_id' => function () {
|
|
||||||
return Manufacturer::where('name', 'Apple')->first() ?? Manufacturer::factory()->apple();
|
|
||||||
},
|
|
||||||
'eol' => '12',
|
|
||||||
'depreciation_id' => function () {
|
|
||||||
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
||||||
},
|
|
||||||
'image' => 'iphone12.jpeg',
|
|
||||||
'fieldset_id' => function () use ($field) {
|
'fieldset_id' => function () use ($field) {
|
||||||
return CustomFieldset::where('name', 'Has Encrypted Custom Field')->first() ?? CustomFieldset::factory()->has_encrypted_custom_field()->hasAttached(CustomField::where('name', 'Test Encrypted')->first(), ['order' => 1, 'required' => 0], 'fields');
|
return CustomFieldset::where('name', 'Has Encrypted Custom Field')->first() ?? CustomFieldset::factory()->has_encrypted_custom_field()->hasAttached(CustomField::where('name', 'Test Encrypted')->first(), ['order' => 1, 'required' => 0], 'fields');
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue