12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
50
database/factories/CompanyFactory.php
Normal file
50
database/factories/CompanyFactory.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\CompanyType;
|
||||
use App\Enums\Portal;
|
||||
use App\Models\Company;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Company>
|
||||
*/
|
||||
class CompanyFactory extends Factory
|
||||
{
|
||||
protected $model = Company::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$name = fake()->company();
|
||||
|
||||
return [
|
||||
'portal' => fake()->randomElement([Portal::Presseecho->value, Portal::Businessportal24->value]),
|
||||
'type' => fake()->randomElement(CompanyType::cases())->value,
|
||||
'name' => $name,
|
||||
'slug' => Str::slug($name).'-'.fake()->unique()->numberBetween(1000, 9999),
|
||||
'address' => fake()->streetAddress(),
|
||||
'country_code' => 'DE',
|
||||
'phone' => fake()->phoneNumber(),
|
||||
'email' => fake()->companyEmail(),
|
||||
'website' => fake()->url(),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function presseecho(): static
|
||||
{
|
||||
return $this->state(['portal' => Portal::Presseecho->value]);
|
||||
}
|
||||
|
||||
public function businessportal24(): static
|
||||
{
|
||||
return $this->state(['portal' => Portal::Businessportal24->value]);
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(['is_active' => false]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue