]> BookStack Code Mirror - bookstack/blob - database/factories/Entities/Models/PageFactory.php
8115700950ced18a76eaadf9620c4dd1b431b633
[bookstack] / database / factories / Entities / Models / PageFactory.php
1 <?php
2
3 namespace Database\Factories\Entities\Models;
4
5 use BookStack\Entities\Tools\PageEditorType;
6 use Illuminate\Database\Eloquent\Factories\Factory;
7 use Illuminate\Support\Str;
8
9 class PageFactory extends Factory
10 {
11     /**
12      * The name of the factory's corresponding model.
13      *
14      * @var string
15      */
16     protected $model = \BookStack\Entities\Models\Page::class;
17
18     /**
19      * Define the model's default state.
20      *
21      * @return array
22      */
23     public function definition()
24     {
25         $html = '<p>' . implode('</p>', $this->faker->paragraphs(5)) . '</p>';
26
27         return [
28             'name'           => $this->faker->sentence(),
29             'slug'           => Str::random(10),
30             'html'           => $html,
31             'text'           => strip_tags($html),
32             'revision_count' => 1,
33             'editor'         => 'wysiwyg',
34         ];
35     }
36 }