31 lines
639 B
PHP
31 lines
639 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Models\Page;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
use Illuminate\Support\Str;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @extends Factory<Page>
|
||
|
|
*/
|
||
|
|
class PageFactory extends Factory
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @return array<string, mixed>
|
||
|
|
*/
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
$title = fake()->unique()->words(2, true);
|
||
|
|
|
||
|
|
return [
|
||
|
|
'title' => Str::title($title),
|
||
|
|
'slug' => Str::slug($title),
|
||
|
|
'body' => implode("\n\n", fake()->paragraphs(3)),
|
||
|
|
'published' => true,
|
||
|
|
'show_in_footer' => true,
|
||
|
|
'order' => 0,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|