42 lines
1 KiB
PHP
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]);
|
|
}
|
|
}
|