presseportale/database/factories/FooterCodeFactory.php
Kevin Adametz 5b8bdf4182
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
12-05-2026 Frontend dev
2026-05-12 18:32:33 +02:00

42 lines
1 KiB
PHP

<?php
namespace Database\Factories;
use App\Enums\Portal;
use App\Models\FooterCode;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<FooterCode>
*/
class FooterCodeFactory extends Factory
{
protected $model = FooterCode::class;
public function definition(): array
{
return [
'portal' => fake()->randomElement([
Portal::Both->value,
Portal::Presseecho->value,
Portal::Businessportal24->value,
]),
'language' => fake()->randomElement([null, 'de', 'en']),
'title' => fake()->sentence(3),
'content' => fake()->paragraph(),
'is_global' => false,
'is_active' => true,
'priority' => fake()->numberBetween(0, 100),
];
}
public function global(): static
{
return $this->state(['is_global' => true]);
}
public function inactive(): static
{
return $this->state(['is_active' => false]);
}
}