2017-10-07 02:27:02 -07:00
|
|
|
<?php
|
2021-06-10 13:19:27 -07:00
|
|
|
|
2021-06-10 13:17:44 -07:00
|
|
|
namespace Database\Factories;
|
|
|
|
|
2023-03-20 11:39:27 -07:00
|
|
|
use App\Models\AssetModel;
|
2024-04-15 10:46:11 -07:00
|
|
|
use App\Models\CustomField;
|
2023-03-15 18:49:21 -07:00
|
|
|
use App\Models\CustomFieldset;
|
2023-03-14 17:51:20 -07:00
|
|
|
use App\Models\Depreciation;
|
2023-03-14 12:01:23 -07:00
|
|
|
use App\Models\Manufacturer;
|
2023-03-13 17:27:06 -07:00
|
|
|
use App\Models\User;
|
2021-06-10 13:19:27 -07:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2021-12-02 16:14:45 -08:00
|
|
|
use App\Models\Category;
|
2017-10-07 02:27:02 -07:00
|
|
|
|
2021-06-10 13:17:44 -07:00
|
|
|
class AssetModelFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2023-03-20 11:39:27 -07:00
|
|
|
protected $model = AssetModel::class;
|
2021-06-10 13:17:44 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
2023-03-20 11:19:34 -07:00
|
|
|
'user_id' => User::factory()->superuser(),
|
2021-12-02 16:14:45 -08:00
|
|
|
'name' => $this->faker->catchPhrase(),
|
2023-03-16 17:08:18 -07:00
|
|
|
'category_id' => Category::factory(),
|
2021-06-10 13:17:44 -07:00
|
|
|
'model_number' => $this->faker->creditCardNumber(),
|
|
|
|
'notes' => 'Created by demo seeder',
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function mbp13Model()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Macbook Pro 13"',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'mbp.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function mbpAirModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Macbook Air',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Apple')->first() ?? Manufacturer::factory()->apple();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'macbookair.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function surfaceModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Surface',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Microsoft')->first() ?? Manufacturer::factory()->microsoft();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'surface.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function xps13Model()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'XPS 13',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Dell')->first() ?? Manufacturer::factory()->dell();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'xps.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function zenbookModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'ZenBook UX310',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
2023-03-14 12:04:31 -07:00
|
|
|
return Manufacturer::where('name', 'Asus')->first() ?? Manufacturer::factory()->asus();
|
2023-03-14 12:01:23 -07:00
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'zenbook.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function spectreModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Spectre',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'HP')->first() ?? Manufacturer::factory()->hp();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'spectre.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function yogaModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Yoga 910',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Laptops')->first() ?? Category::factory()->assetLaptopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Lenovo')->first() ?? Manufacturer::factory()->lenovo();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '36',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'yoga.png',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function macproModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'iMac Pro',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function (){
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Desktops')->first() ?? Category::factory()->assetDesktopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Apple')->first() ?? Manufacturer::factory()->apple();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '24',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'imacpro.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function lenovoI5Model()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Lenovo Intel Core i5',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Desktops')->first() ?? Category::factory()->assetDesktopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Lenovo')->first() ?? Manufacturer::factory()->lenovo();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '24',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'lenovoi5.png',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function optiplexModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'OptiPlex',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function (){
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Desktops')->first() ?? Category::factory()->assetDesktopCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Dell')->first() ?? Manufacturer::factory()->dell();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'model_number' => '5040 (MRR81)',
|
|
|
|
'eol' => '24',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'optiplex.jpg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Laptops and Desktops')->first() ?? CustomFieldset::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function polycomModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'SoundStation 2',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'VOIP Phones')->first() ?? Category::factory()->assetVoipCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Polycom')->first() ?? Manufacturer::factory()->polycom();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'soundstation.jpg',
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function polycomcxModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Polycom CX3000 IP Conference Phone',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'VOIP Phones')->first() ?? Category::factory()->assetVoipCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Polycom')->first() ?? Manufacturer::factory()->polycom();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'cx3000.png',
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ipadModel()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'iPad Pro',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Tablets')->first() ?? Category::factory()->assetTabletCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Apple')->first() ?? Manufacturer::factory()->apple();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'ipad.jpg',
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tab3Model()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Tab3',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Tablets')->first() ?? Category::factory()->assetTabletCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Lenovo')->first() ?? Manufacturer::factory()->lenovo();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'tab3.png',
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-07-21 15:12:27 -07:00
|
|
|
public function iphone11Model()
|
2021-06-10 13:17:44 -07:00
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
2021-07-21 15:12:27 -07:00
|
|
|
'name' => 'iPhone 11',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Mobile Phones')->first() ?? Category::factory()->assetMobileCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Apple')->first() ?? Manufacturer::factory()->apple();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Mobile Phone Depreciation')->first() ?? Depreciation::factory()->mobilePhones();
|
|
|
|
},
|
2021-07-21 15:12:27 -07:00
|
|
|
'image' => 'iphone11.jpeg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Mobile Devices')->first() ?? CustomFieldset::factory()->mobile();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-07-21 15:12:27 -07:00
|
|
|
public function iphone12Model()
|
2021-06-10 13:17:44 -07:00
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
2021-07-21 15:12:27 -07:00
|
|
|
'name' => 'iPhone 12',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Mobile Phones')->first() ?? Category::factory()->assetMobileCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Apple')->first() ?? Manufacturer::factory()->apple();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Computer Depreciation')->first() ?? Depreciation::factory()->computer();
|
|
|
|
},
|
2021-07-21 15:12:27 -07:00
|
|
|
'image' => 'iphone12.jpeg',
|
2023-03-15 18:49:21 -07:00
|
|
|
'fieldset_id' => function () {
|
|
|
|
return CustomFieldset::where('name', 'Mobile Devices')->first() ?? CustomFieldset::factory()->mobile();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ultrafine()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Ultrafine 4k',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Displays')->first() ?? Category::factory()->assetDisplayCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'LG')->first() ?? Manufacturer::factory()->lg();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Display Depreciation')->first() ?? Depreciation::factory()->display();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'ultrafine.jpg',
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ultrasharp()
|
|
|
|
{
|
|
|
|
return $this->state(function () {
|
|
|
|
return [
|
|
|
|
'name' => 'Ultrasharp U2415',
|
2023-03-13 17:27:06 -07:00
|
|
|
'category_id' => function () {
|
2023-03-14 12:50:02 -07:00
|
|
|
return Category::where('name', 'Displays')->first() ?? Category::factory()->assetDisplayCategory();
|
2023-03-13 17:27:06 -07:00
|
|
|
},
|
2023-03-14 12:01:23 -07:00
|
|
|
'manufacturer_id' => function () {
|
|
|
|
return Manufacturer::where('name', 'Dell')->first() ?? Manufacturer::factory()->dell();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'eol' => '12',
|
2023-03-14 17:51:20 -07:00
|
|
|
'depreciation_id' => function () {
|
|
|
|
return Depreciation::where('name', 'Display Depreciation')->first() ?? Depreciation::factory()->display();
|
|
|
|
},
|
2021-06-10 13:17:44 -07:00
|
|
|
'image' => 'ultrasharp.jpg',
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
2024-04-15 10:46:11 -07:00
|
|
|
|
2024-04-16 16:58:28 -07:00
|
|
|
public function hasEncryptedCustomField(CustomField $field = null)
|
2024-04-15 10:46:11 -07:00
|
|
|
{
|
2024-04-16 16:58:28 -07:00
|
|
|
return $this->state(function () use ($field) {
|
2024-04-15 10:46:11 -07:00
|
|
|
return [
|
2024-04-16 16:58:28 -07:00
|
|
|
'fieldset_id' => CustomFieldset::factory()->hasEncryptedCustomField($field),
|
2024-04-15 10:46:11 -07:00
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
2024-05-01 14:12:56 -07:00
|
|
|
|
|
|
|
public function hasMultipleCustomFields(array $fields = null)
|
|
|
|
{
|
|
|
|
return $this->state(function () use ($fields) {
|
|
|
|
return [
|
|
|
|
'fieldset_id' => CustomFieldset::factory()->hasMultipleCustomFields($fields),
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
2021-06-10 13:17:44 -07:00
|
|
|
}
|