snipe-it/database/factories/CategoryFactory.php
Laravel Shift 934afa036f Adopt Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions.

You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started.

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
2021-06-10 20:15:52 +00:00

127 lines
3.3 KiB
PHP

<?php
/*
|--------------------------------------------------------------------------
| Category Factories
|--------------------------------------------------------------------------
|
| Factories related exclusively to creating categories and the various states..
|
*/
$factory->define(App\Models\Category::class, function (Faker\Generator $faker) {
return [
'checkin_email' => $faker->boolean(),
'eula_text' => $faker->paragraph(),
'require_acceptance' => false,
'use_default_eula' => $faker->boolean(),
'user_id' => 1,
];
});
$factory->state(App\Models\Category::class, 'asset-laptop-category', function ($faker) {
return [
'name' => 'Laptops',
'category_type' => 'asset',
'require_acceptance' => true,
];
});
$factory->state(App\Models\Category::class, 'asset-desktop-category', function ($faker) {
return [
'name' => 'Desktops',
'category_type' => 'asset',
];
});
$factory->state(App\Models\Category::class, 'asset-display-category', function ($faker) {
return [
'name' => 'Displays',
'category_type' => 'asset',
];
});
$factory->state(App\Models\Category::class, 'asset-tablet-category', function ($faker) {
return [
'name' => 'Tablets',
'category_type' => 'asset',
];
});
$factory->state(App\Models\Category::class, 'asset-mobile-category', function ($faker) {
return [
'name' => 'Mobile Phones',
'category_type' => 'asset',
];
});
$factory->state(App\Models\Category::class, 'asset-conference-category', function ($faker) {
return [
'name' => 'Conference Phones',
'category_type' => 'asset',
];
});
$factory->state(App\Models\Category::class, 'asset-voip-category', function ($faker) {
return [
'name' => 'VOIP Phones',
'category_type' => 'asset',
];
});
$factory->state(App\Models\Category::class, 'accessory-keyboard-category', function ($faker) {
return [
'name' => 'Keyboards',
'category_type' => 'accessory',
];
});
$factory->state(App\Models\Category::class, 'accessory-mouse-category', function ($faker) {
return [
'name' => 'Mouse',
'category_type' => 'accessory',
];
});
$factory->state(App\Models\Category::class, 'component-hdd-category', function ($faker) {
return [
'name' => 'HDD/SSD',
'category_type' => 'component',
];
});
$factory->state(App\Models\Category::class, 'component-ram-category', function ($faker) {
return [
'name' => 'RAM',
'category_type' => 'component',
];
});
$factory->state(App\Models\Category::class, 'consumable-paper-category', function ($faker) {
return [
'name' => 'Printer Paper',
'category_type' => 'consumable',
];
});
$factory->state(App\Models\Category::class, 'consumable-ink-category', function ($faker) {
return [
'name' => 'Printer Ink',
'category_type' => 'consumable',
];
});
$factory->state(App\Models\Category::class, 'license-graphics-category', function ($faker) {
return [
'name' => 'Graphics Software',
'category_type' => 'license',
];
});
$factory->state(App\Models\Category::class, 'license-office-category', function ($faker) {
return [
'name' => 'Office Software',
'category_type' => 'license',
];
});