first commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user