34 lines
860 B
PHP
34 lines
860 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
use App\Models\PageRevision;
|
|
use App\Models\Page;
|
|
use App\Models\User;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PageRevision>
|
|
*/
|
|
class PageRevisionFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array {
|
|
return [
|
|
'page_id' => Page::factory(),
|
|
'user_id' => User::factory(),
|
|
'version' => 1,
|
|
'content' => ['blocks' => []],
|
|
'title' => $this->faker->sentence,
|
|
'slug' => $this->faker->slug,
|
|
'label' => $this->faker->randomElement(['auto-save', 'manual-save', 'published', 'restored']),
|
|
'active' => true,
|
|
];
|
|
}
|
|
}
|