From dd1d4561068033989a7b579a080a4bc069c9b325 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 17 Feb 2026 15:21:24 +0000 Subject: [PATCH] Alphabetize dictionary --- database/factories/AssetModelFactory.php | 4 ++-- database/factories/CategoryFactory.php | 8 ++++---- database/factories/ComponentFactory.php | 19 +++++++++-------- database/factories/ConsumableFactory.php | 12 +++++------ database/factories/CustomFieldFactory.php | 2 ++ database/factories/DepartmentFactory.php | 2 +- database/factories/DepreciationFactory.php | 2 +- database/factories/GroupFactory.php | 4 +++- database/factories/LicenseFactory.php | 24 +++++++++++----------- database/factories/LocationFactory.php | 8 +++++--- database/factories/ManufacturerFactory.php | 8 ++++---- database/factories/StatuslabelFactory.php | 8 ++++---- database/factories/SupplierFactory.php | 16 ++++++++------- database/factories/UserFactory.php | 8 ++++---- 14 files changed, 67 insertions(+), 58 deletions(-) diff --git a/database/factories/AssetModelFactory.php b/database/factories/AssetModelFactory.php index ac31b57984..b59293cdbe 100644 --- a/database/factories/AssetModelFactory.php +++ b/database/factories/AssetModelFactory.php @@ -28,10 +28,10 @@ class AssetModelFactory extends Factory public function definition() { return [ - 'created_by' => User::factory()->superuser(), - 'name' => $this->faker->catchPhrase(), 'category_id' => Category::factory(), + 'created_by' => User::factory()->superuser(), 'model_number' => $this->faker->creditCardNumber(), + 'name' => $this->faker->catchPhrase(), 'notes' => 'Created by demo seeder', 'require_serial' => 0, diff --git a/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php index d7ae1b3ffd..95d282da01 100644 --- a/database/factories/CategoryFactory.php +++ b/database/factories/CategoryFactory.php @@ -23,15 +23,15 @@ class CategoryFactory extends Factory public function definition() { return [ - 'name' => $this->faker->catchPhrase(), 'category_type' => 'asset', 'checkin_email' => true, - 'eula_text' => $this->faker->paragraph(), - 'require_acceptance' => false, - 'use_default_eula' => false, 'created_by' => User::factory()->superuser(), + 'eula_text' => $this->faker->paragraph(), + 'name' => $this->faker->catchPhrase(), 'notes' => 'Created by DB seeder', + 'require_acceptance' => false, 'tag_color' => $this->faker->hexColor(), + 'use_default_eula' => false, ]; } diff --git a/database/factories/ComponentFactory.php b/database/factories/ComponentFactory.php index 786e780895..9230d2cafc 100644 --- a/database/factories/ComponentFactory.php +++ b/database/factories/ComponentFactory.php @@ -33,18 +33,19 @@ class ComponentFactory extends Factory { return [ - 'name' => $this->faker->text(20), 'category_id' => Category::factory(), - 'location_id' => Location::factory(), - 'serial' => $this->faker->uuid(), - 'qty' => $this->faker->numberBetween(3, 10), - 'order_number' => $this->faker->numberBetween(1000000, 50000000), - 'purchase_date' => $this->faker->dateTime()->format('Y-m-d'), - 'purchase_cost' => $this->faker->randomFloat(2), - 'min_amt' => $this->faker->numberBetween($min = 1, $max = 2), 'company_id' => Company::factory(), - 'supplier_id' => Supplier::factory(), + 'created_by' => User::factory()->superuser(), + 'location_id' => Location::factory(), + 'min_amt' => $this->faker->numberBetween($min = 1, $max = 2), 'model_number' => $this->faker->numberBetween(1000000, 50000000), + 'name' => $this->faker->text(20), + 'order_number' => $this->faker->numberBetween(1000000, 50000000), + 'purchase_cost' => $this->faker->randomFloat(2), + 'purchase_date' => $this->faker->dateTime()->format('Y-m-d'), + 'qty' => $this->faker->numberBetween(3, 10), + 'serial' => $this->faker->uuid(), + 'supplier_id' => Supplier::factory(), ]; } diff --git a/database/factories/ConsumableFactory.php b/database/factories/ConsumableFactory.php index 4a4b3ef872..775e286dd4 100644 --- a/database/factories/ConsumableFactory.php +++ b/database/factories/ConsumableFactory.php @@ -28,16 +28,16 @@ class ConsumableFactory extends Factory public function definition() { return [ - 'name' => $this->faker->words(3, true), 'category_id' => Category::factory(), + 'company_id' => Company::factory(), 'created_by' => User::factory()->superuser(), 'item_no' => $this->faker->numberBetween(1000000, 50000000), - 'order_number' => $this->faker->numberBetween(1000000, 50000000), - 'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get())->format('Y-m-d'), - 'purchase_cost' => $this->faker->randomFloat(2, 1, 50), - 'qty' => $this->faker->numberBetween(5, 10), 'min_amt' => $this->faker->numberBetween($min = 1, $max = 2), - 'company_id' => Company::factory(), + 'name' => $this->faker->words(3, true), + 'order_number' => $this->faker->numberBetween(1000000, 50000000), + 'purchase_cost' => $this->faker->randomFloat(2, 1, 50), + 'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get())->format('Y-m-d'), + 'qty' => $this->faker->numberBetween(5, 10), 'supplier_id' => Supplier::factory(), ]; } diff --git a/database/factories/CustomFieldFactory.php b/database/factories/CustomFieldFactory.php index 30c41ce4e5..ac1fc1f1f5 100644 --- a/database/factories/CustomFieldFactory.php +++ b/database/factories/CustomFieldFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use App\Models\CustomField; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; class CustomFieldFactory extends Factory @@ -27,6 +28,7 @@ class CustomFieldFactory extends Factory 'element' => 'text', 'auto_add_to_fieldsets' => '0', 'show_in_requestable_list' => '0', + 'created_by' => User::factory()->superuser(), ]; } diff --git a/database/factories/DepartmentFactory.php b/database/factories/DepartmentFactory.php index 66bccd241b..bf2a4db683 100644 --- a/database/factories/DepartmentFactory.php +++ b/database/factories/DepartmentFactory.php @@ -24,9 +24,9 @@ class DepartmentFactory extends Factory public function definition() { return [ - 'name' => $this->faker->unique()->word() . ' Department', 'created_by' => User::factory()->superuser(), 'location_id' => Location::factory(), + 'name' => $this->faker->unique()->word() . ' Department', 'notes' => 'Created by DB seeder', 'tag_color' => $this->faker->hexColor(), ]; diff --git a/database/factories/DepreciationFactory.php b/database/factories/DepreciationFactory.php index 52258e784b..4f9ab0b327 100644 --- a/database/factories/DepreciationFactory.php +++ b/database/factories/DepreciationFactory.php @@ -23,9 +23,9 @@ class DepreciationFactory extends Factory public function definition() { return [ - 'name' => $this->faker->unique()->catchPhrase(), 'created_by' => User::factory()->superuser(), 'months' => 36, + 'name' => $this->faker->unique()->catchPhrase(), ]; } diff --git a/database/factories/GroupFactory.php b/database/factories/GroupFactory.php index fecf8239bb..44bdb94cfd 100644 --- a/database/factories/GroupFactory.php +++ b/database/factories/GroupFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use App\Models\Group; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; class GroupFactory extends Factory @@ -22,9 +23,10 @@ class GroupFactory extends Factory public function definition() { return [ + 'created_by' => User::factory()->superuser(), 'name' => $this->faker->name(), - 'permissions' => json_encode([]), 'notes' => 'Created by DB seeder', + 'permissions' => json_encode([]), ]; } } diff --git a/database/factories/LicenseFactory.php b/database/factories/LicenseFactory.php index 591a36da1f..c968a553c4 100644 --- a/database/factories/LicenseFactory.php +++ b/database/factories/LicenseFactory.php @@ -25,19 +25,19 @@ class LicenseFactory extends Factory public function definition() { return [ - 'created_by' => User::factory()->superuser(), - 'name' => $this->faker->name(), - 'license_email' => $this->faker->safeEmail(), - 'serial' => $this->faker->uuid(), - 'notes' => 'Created by DB seeder', - 'seats' => $this->faker->numberBetween(1, 10), - 'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get())->format('Y-m-d'), - 'order_number' => $this->faker->numberBetween(1000000, 50000000), - 'expiration_date' => null, - 'reassignable' => $this->faker->boolean(), - 'termination_date' => null, - 'supplier_id' => Supplier::factory(), 'category_id' => Category::factory(), + 'created_by' => User::factory()->superuser(), + 'expiration_date' => null, + 'license_email' => $this->faker->safeEmail(), + 'name' => $this->faker->name(), + 'notes' => 'Created by DB seeder', + 'order_number' => $this->faker->numberBetween(1000000, 50000000), + 'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get())->format('Y-m-d'), + 'reassignable' => $this->faker->boolean(), + 'seats' => $this->faker->numberBetween(1, 10), + 'serial' => $this->faker->uuid(), + 'supplier_id' => Supplier::factory(), + 'termination_date' => null, ]; } diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php index 6d59281cba..4dbb4d09a2 100644 --- a/database/factories/LocationFactory.php +++ b/database/factories/LocationFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; class LocationFactory extends Factory @@ -14,17 +15,18 @@ class LocationFactory extends Factory public function definition() { return [ - 'name' => $this->faker->city(), 'address' => $this->faker->streetAddress(), 'address2' => $this->faker->secondaryAddress(), 'city' => $this->faker->city(), - 'state' => $this->faker->stateAbbr(), 'country' => $this->faker->countryCode(), + 'created_by' => User::factory()->superuser(), 'currency' => $this->faker->currencyCode(), - 'zip' => $this->faker->postcode(), 'image' => rand(1, 9).'.jpg', + 'name' => $this->faker->city(), 'notes' => 'Created by DB seeder', + 'state' => $this->faker->stateAbbr(), 'tag_color' => $this->faker->hexColor(), + 'zip' => $this->faker->postcode(), ]; } diff --git a/database/factories/ManufacturerFactory.php b/database/factories/ManufacturerFactory.php index c477325fb3..c8c88f6da6 100644 --- a/database/factories/ManufacturerFactory.php +++ b/database/factories/ManufacturerFactory.php @@ -23,13 +23,13 @@ class ManufacturerFactory extends Factory public function definition() { return [ - 'name' => $this->faker->unique()->company(), 'created_by' => User::factory()->superuser(), - 'support_phone' => $this->faker->phoneNumber(), - 'url' => $this->faker->url(), - 'support_email' => $this->faker->safeEmail(), + 'name' => $this->faker->unique()->company(), 'notes' => 'Created by DB seeder', + 'support_email' => $this->faker->safeEmail(), + 'support_phone' => $this->faker->phoneNumber(), 'tag_color' => $this->faker->hexColor(), + 'url' => $this->faker->url(), ]; } diff --git a/database/factories/StatuslabelFactory.php b/database/factories/StatuslabelFactory.php index 1f04f4564e..45154780b8 100644 --- a/database/factories/StatuslabelFactory.php +++ b/database/factories/StatuslabelFactory.php @@ -23,15 +23,15 @@ class StatuslabelFactory extends Factory public function definition() { return [ - 'name' => $this->faker->sentence(), + 'archived' => 0, 'created_at' => $this->faker->dateTime(), - 'updated_at' => $this->faker->dateTime(), 'created_by' => User::factory()->superuser(), 'deleted_at' => null, 'deployable' => 0, - 'pending' => 0, - 'archived' => 0, + 'name' => $this->faker->sentence(), 'notes' => '', + 'pending' => 0, + 'updated_at' => $this->faker->dateTime(), ]; } diff --git a/database/factories/SupplierFactory.php b/database/factories/SupplierFactory.php index ba11dbca66..2c3e6af415 100644 --- a/database/factories/SupplierFactory.php +++ b/database/factories/SupplierFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use App\Models\Supplier; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; class SupplierFactory extends Factory @@ -22,20 +23,21 @@ class SupplierFactory extends Factory public function definition() { return [ - 'name' => $this->faker->company(), 'address' => $this->faker->streetAddress(), 'address2' => $this->faker->secondaryAddress(), 'city' => $this->faker->city(), - 'state' => $this->faker->stateAbbr(), - 'zip' => $this->faker->postCode(), - 'country' => $this->faker->countryCode(), 'contact' => $this->faker->name(), - 'phone' => $this->faker->phoneNumber(), - 'fax' => $this->faker->phoneNumber(), + 'country' => $this->faker->countryCode(), + 'created_by' => User::factory()->superuser(), 'email' => $this->faker->safeEmail(), - 'url' => $this->faker->url(), + 'fax' => $this->faker->phoneNumber(), + 'name' => $this->faker->company(), 'notes' => $this->faker->text(191), // Supplier notes can be a max of 255 characters. + 'phone' => $this->faker->phoneNumber(), + 'state' => $this->faker->stateAbbr(), 'tag_color' => $this->faker->hexColor(), + 'url' => $this->faker->url(), + 'zip' => $this->faker->postCode(), ]; } } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 989fad08f2..7b5d9045d0 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -25,22 +25,22 @@ class UserFactory extends Factory 'city' => $this->faker->city(), 'company_id' => Company::factory(), 'country' => $this->faker->country(), + 'created_by' => 1, + 'display_name' => null, 'email' => $this->faker->safeEmail(), 'employee_num' => $this->faker->numberBetween(3500, 35050), 'first_name' => $this->faker->firstName(), - 'last_name' => $this->faker->lastName(), - 'display_name' => null, 'jobtitle' => $this->faker->jobTitle(), + 'last_name' => $this->faker->lastName(), 'locale' => 'en-US', + 'mobile' => $this->faker->phoneNumber(), 'notes' => 'Created by DB seeder', 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'permissions' => '{}', 'phone' => $this->faker->phoneNumber(), - 'mobile' => $this->faker->phoneNumber(), 'state' => $this->faker->stateAbbr(), 'username' => $this->faker->unique()->username(), 'zip' => $this->faker->postcode(), - 'created_by' => 1, ]; }