]> BookStack Code Mirror - bookstack/blob - database/factories/Entities/Models/ChapterFactory.php
Input WYSIWYG: Updated tests, Added simple html limiting
[bookstack] / database / factories / Entities / Models / ChapterFactory.php
1 <?php
2
3 namespace Database\Factories\Entities\Models;
4
5 use Illuminate\Database\Eloquent\Factories\Factory;
6 use Illuminate\Support\Str;
7
8 class ChapterFactory extends Factory
9 {
10     /**
11      * The name of the factory's corresponding model.
12      *
13      * @var string
14      */
15     protected $model = \BookStack\Entities\Models\Chapter::class;
16
17     /**
18      * Define the model's default state.
19      *
20      * @return array
21      */
22     public function definition()
23     {
24         $description = $this->faker->paragraph();
25         return [
26             'name'        => $this->faker->sentence(),
27             'slug'        => Str::random(10),
28             'description' => $description,
29             'description_html' => '<p>' . e($description) . '</p>'
30         ];
31     }
32 }