36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\StaticPageType;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\SellItem>
|
|
*/
|
|
class StaticPageFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$title = fake()->unique()->words(rand(1, 2), true);
|
|
return [
|
|
'type' => \collect(StaticPageType::toArray())->random()->value,
|
|
'seo_title' => fake()->sentence(),
|
|
'seo_description' => fake()->sentence(),
|
|
'title' => $title,
|
|
'slug' => Str::slug($title),
|
|
'subtitle' => fake()->words(rand(1, 2), true),
|
|
'picture' => '',
|
|
'picture_alt' => fake()->sentence(),
|
|
'picture_title' => fake()->sentence(),
|
|
'content' => fake()->sentence(),
|
|
'data' => [],
|
|
];
|
|
}
|
|
}
|