]> BookStack Code Mirror - bookstack/blob - database/factories/ModelFactory.php
6a1ab049cb7bac695161c687e1f6f97ee533df57
[bookstack] / database / factories / ModelFactory.php
1 <?php
2
3 /*
4 |--------------------------------------------------------------------------
5 | Model Factories
6 |--------------------------------------------------------------------------
7 |
8 | Here you may define all of your model factories. Model factories give
9 | you a convenient way to create models for testing and seeding your
10 | database. Just tell the factory how a default model should look.
11 |
12 */
13
14 $factory->define(BookStack\User::class, function ($faker) {
15     return [
16         'name'           => $faker->name,
17         'email'          => $faker->email,
18         'password'       => str_random(10),
19         'remember_token' => str_random(10),
20     ];
21 });
22
23 $factory->define(BookStack\Book::class, function ($faker) {
24     return [
25         'name'        => $faker->sentence,
26         'description' => $faker->paragraph
27     ];
28 });
29
30 $factory->define(BookStack\Chapter::class, function ($faker) {
31     return [
32         'name'        => $faker->sentence,
33         'description' => $faker->paragraph
34     ];
35 });
36
37 $factory->define(BookStack\Page::class, function ($faker) {
38     return [
39         'name' => $faker->sentence,
40         'html' => '<p>' . implode('</p>', $faker->paragraphs(5)) . '</p>'
41     ];
42 });