20-02-2026

This commit is contained in:
Kevin Adametz 2026-02-20 17:57:50 +01:00
parent 854ce02bf6
commit 4d6b4930b2
128 changed files with 18247 additions and 2093 deletions

View file

@ -0,0 +1,79 @@
<?php
namespace Database\Factories;
use App\Models\Partner;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends Factory<Partner>
*/
class PartnerFactory extends Factory
{
protected $model = Partner::class;
public function definition(): array
{
$company = fake()->company();
return [
'company_name' => $company,
'slug' => Str::slug($company).'-'.fake()->unique()->numberBetween(100, 999),
'type' => 'Retailer',
'is_active' => true,
];
}
/**
* Händler (Retailer).
*/
public function retailer(): static
{
return $this->state(fn (array $attributes) => [
'type' => 'Retailer',
'delivery_radius_km' => fake()->numberBetween(10, 100),
]);
}
/**
* Hersteller (Manufacturer).
*/
public function manufacturer(): static
{
return $this->state(fn (array $attributes) => [
'type' => 'Manufacturer',
]);
}
/**
* Makler (Estate-Agent).
*/
public function estateAgent(): static
{
return $this->state(fn (array $attributes) => [
'type' => 'Estate-Agent',
]);
}
/**
* Partner mit Setup abgeschlossen.
*/
public function setupCompleted(): static
{
return $this->state(fn (array $attributes) => [
'setup_completed' => true,
'setup_completed_at' => now(),
]);
}
/**
* Inaktiver Partner.
*/
public function inactive(): static
{
return $this->state(fn (array $attributes) => [
'is_active' => false,
]);
}
}