diff --git a/src/Factories/AccessoryFactory.php b/src/Factories/AccessoryFactory.php index 764cc68..394d4dd 100644 --- a/src/Factories/AccessoryFactory.php +++ b/src/Factories/AccessoryFactory.php @@ -27,7 +27,7 @@ public function definition(): array 'name' => fake()->words(5, true), 'description' => fake()->text, 'category_id' => Category::inRandomOrder()->first(), - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id, + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id, ]; } } diff --git a/src/Factories/BuyingOptionFactory.php b/src/Factories/BuyingOptionFactory.php index f19c91a..e52394b 100644 --- a/src/Factories/BuyingOptionFactory.php +++ b/src/Factories/BuyingOptionFactory.php @@ -34,7 +34,7 @@ public function definition(): array 'when_flow_validated' => fake()->randomKey(BuyingOption::WHEN_FLOW_VALIDATED_LIST), 'when_make_sale' => fake()->randomKey(BuyingOption::WHEN_MAKE_SALE_LIST), 'when_reserve_unit' => fake()->randomKey(BuyingOption::WHEN_RESERVE_UNIT_LIST), - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id, + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id, ]; } } diff --git a/src/Factories/CategoryFactory.php b/src/Factories/CategoryFactory.php index 880e06d..b084768 100644 --- a/src/Factories/CategoryFactory.php +++ b/src/Factories/CategoryFactory.php @@ -25,7 +25,7 @@ public function definition(): array 'uuid' => fake()->uuid(), 'name' => fake()->words(5, true), 'description' => fake()->text, - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id, + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id, ]; } } diff --git a/src/Factories/CharacteristicFactory.php b/src/Factories/CharacteristicFactory.php index 776d505..403cd9f 100644 --- a/src/Factories/CharacteristicFactory.php +++ b/src/Factories/CharacteristicFactory.php @@ -31,7 +31,7 @@ public function definition(): array 'name' => fake()->words(5, true), 'description' => fake()->text, 'icon' => 'https://placeimg.com/640/480/any?' . fake()->uuid, - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id, + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id, ]; } } diff --git a/src/Factories/InsuranceCompanyFactory.php b/src/Factories/InsuranceCompanyFactory.php index ccde39c..e88c037 100644 --- a/src/Factories/InsuranceCompanyFactory.php +++ b/src/Factories/InsuranceCompanyFactory.php @@ -28,7 +28,7 @@ public function definition(): array 'document' => fake()->cnpj(false), 'susep' => fake()->numerify('#####'), 'is_active' => fake()->boolean(), - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id, + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id, ]; } } diff --git a/src/Factories/ProposalModelFactory.php b/src/Factories/ProposalModelFactory.php index 2e46bdb..8885d75 100644 --- a/src/Factories/ProposalModelFactory.php +++ b/src/Factories/ProposalModelFactory.php @@ -29,7 +29,7 @@ public function definition(): array return [ 'uuid' => fake()->uuid(), 'name' => fake()->words(5, true), - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id ]; } } diff --git a/src/Factories/RealEstateDevelopmentFactory.php b/src/Factories/RealEstateDevelopmentFactory.php index 65c58ea..721e20e 100644 --- a/src/Factories/RealEstateDevelopmentFactory.php +++ b/src/Factories/RealEstateDevelopmentFactory.php @@ -64,7 +64,7 @@ public function definition(): array 'registry_office' => fake()->words(5, true), 'state' => fake()->state, 'street_number' => fake()->numberBetween(1, 300), - 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()->id, + 'hub_company_id' => config('sp-produto.model_company')::inRandomOrder()->first()?->id, 'external_code' => fake()->unique()->numberBetween(1, 300), 'external_num_code' => fake()->numberBetween(50, 300), 'external_company_code' => fake()->numberBetween(2, 300),