April 2026 waren Wirtschaft Feedback

This commit is contained in:
Kevin Adametz 2026-04-10 17:14:38 +02:00
parent 02f2a4c23e
commit 9ce711d6b2
167 changed files with 25278 additions and 8518 deletions

View file

@ -0,0 +1,48 @@
<?php
namespace Database\Factories;
use App\Models\Country;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Supplier>
*/
class SupplierFactory extends Factory
{
protected $model = Supplier::class;
public function definition(): array
{
return [
'name' => $this->faker->company(),
'url' => $this->faker->optional()->url(),
'contact_person' => $this->faker->optional()->name(),
'email' => $this->faker->optional()->companyEmail(),
'phone' => $this->faker->optional()->phoneNumber(),
'country_id' => Country::query()->value('id') ?? $this->resolveCountryId(),
'notes' => null,
'active' => true,
];
}
protected function resolveCountryId(): int
{
$country = Country::query()->firstOrCreate(
['code' => 'TE'],
[
'phone' => '00',
'en' => 'Testland',
'de' => 'Testland',
'es' => 'Testland',
'fr' => 'Testland',
'it' => 'Testland',
'ru' => 'Testland',
'active' => true,
]
);
return (int) $country->id;
}
}