2017-06-12 17:39:03 -07:00
|
|
|
<?php
|
2021-06-10 13:19:27 -07:00
|
|
|
|
2021-06-10 13:17:44 -07:00
|
|
|
namespace Database\Factories;
|
|
|
|
|
2021-06-10 13:19:27 -07:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2021-12-02 13:40:16 -08:00
|
|
|
use App\Models\Category;
|
2017-06-12 17:39:03 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Category Factories
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Factories related exclusively to creating categories and the various states..
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-06-10 13:17:44 -07:00
|
|
|
class CategoryFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = \App\Models\Category::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
2021-12-02 16:14:45 -08:00
|
|
|
'name' => $this->faker->catchPhrase(),
|
2021-06-10 13:17:44 -07:00
|
|
|
'checkin_email' => $this->faker->boolean(),
|
|
|
|
'eula_text' => $this->faker->paragraph(),
|
|
|
|
'require_acceptance' => false,
|
|
|
|
'use_default_eula' => $this->faker->boolean(),
|
|
|
|
'user_id' => 1,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2021-12-02 13:40:16 -08:00
|
|
|
// usage: Category::factory()->assetLaptopCategory();
|
2021-06-10 13:17:44 -07:00
|
|
|
public function assetLaptopCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Laptops',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
'require_acceptance' => true,
|
|
|
|
]);
|
2021-06-10 13:17:44 -07:00
|
|
|
}
|
|
|
|
|
2021-12-02 13:40:16 -08:00
|
|
|
// usage: Category::factory()->assetDesktopCategory();
|
2021-06-10 13:17:44 -07:00
|
|
|
public function assetDesktopCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Desktops',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
'require_acceptance' => true,
|
|
|
|
]);
|
2021-06-10 13:17:44 -07:00
|
|
|
}
|
|
|
|
|
2021-12-02 13:40:16 -08:00
|
|
|
// usage: Category::factory()->assetDisplayCategory();
|
2021-06-10 13:17:44 -07:00
|
|
|
public function assetDisplayCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Displays',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->assetTabletCategory();
|
|
|
|
public function assetTabletCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Tablets',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->assetMobileCategory();
|
|
|
|
public function assetMobileCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Mobile Phones',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->assetConferenceCategory();
|
|
|
|
public function assetConferenceCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Conference Phones',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// usage: Category::factory()->assetVoipCategory();
|
|
|
|
public function assetVoipCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'VOIP Phones',
|
|
|
|
'category_type' => 'asset',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->accessoryKeyboardCategory();
|
|
|
|
public function accessoryKeyboardCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Keyboardss',
|
|
|
|
'category_type' => 'accessory',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// usage: Category::factory()->accessoryMouseCategory();
|
|
|
|
public function accessoryMouseCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Mouse',
|
|
|
|
'category_type' => 'accessory',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->componentHddCategory();
|
|
|
|
public function componentHddCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'HDD/SSD',
|
|
|
|
'category_type' => 'component',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->componentRamCategory();
|
|
|
|
public function componentRamCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'RAM',
|
|
|
|
'category_type' => 'component',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->consumablePaperCategory();
|
|
|
|
public function consumablePaperCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Printer Paper',
|
|
|
|
'category_type' => 'consumable',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->consumableInkCategory();
|
|
|
|
public function consumableInkCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Printer Ink',
|
|
|
|
'category_type' => 'consumable',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->licenseGraphicsCategory();
|
|
|
|
public function licenseGraphicsCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Graphics Software',
|
|
|
|
'category_type' => 'license',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// usage: Category::factory()->licenseGraphicsCategory();
|
|
|
|
public function licenseOfficeCategory()
|
|
|
|
{
|
2023-03-13 16:45:43 -07:00
|
|
|
return $this->state([
|
2021-12-02 13:40:16 -08:00
|
|
|
'name' => 'Office Software',
|
|
|
|
'category_type' => 'license',
|
|
|
|
]);
|
|
|
|
}
|
2021-06-10 13:17:44 -07:00
|
|
|
|
|
|
|
}
|