4 |--------------------------------------------------------------------------
6 |--------------------------------------------------------------------------
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.
14 $factory->define(\BookStack\Auth\User::class, function ($faker) {
16 'name' => $faker->name,
17 'email' => $faker->email,
18 'password' => Str::random(10),
19 'remember_token' => Str::random(10),
20 'email_confirmed' => 1
24 $factory->define(\BookStack\Entities\Bookshelf::class, function ($faker) {
26 'name' => $faker->sentence,
27 'slug' => Str::random(10),
28 'description' => $faker->paragraph
32 $factory->define(\BookStack\Entities\Book::class, function ($faker) {
34 'name' => $faker->sentence,
35 'slug' => Str::random(10),
36 'description' => $faker->paragraph
40 $factory->define(\BookStack\Entities\Chapter::class, function ($faker) {
42 'name' => $faker->sentence,
43 'slug' => Str::random(10),
44 'description' => $faker->paragraph
48 $factory->define(\BookStack\Entities\Page::class, function ($faker) {
49 $html = '<p>' . implode('</p>', $faker->paragraphs(5)) . '</p>';
51 'name' => $faker->sentence,
52 'slug' => Str::random(10),
54 'text' => strip_tags($html),
59 $factory->define(\BookStack\Auth\Role::class, function ($faker) {
61 'display_name' => $faker->sentence(3),
62 'description' => $faker->sentence(10)
66 $factory->define(\BookStack\Actions\Tag::class, function ($faker) {
68 'name' => $faker->city,
69 'value' => $faker->sentence(3)
73 $factory->define(\BookStack\Uploads\Image::class, function ($faker) {
75 'name' => $faker->slug . '.jpg',
77 'path' => $faker->url,
83 $factory->define(\BookStack\Actions\Comment::class, function($faker) {
84 $text = $faker->paragraph(1);
85 $html = '<p>' . $text. '</p>';