]> BookStack Code Mirror - bookstack/blob - database/factories/ModelFactory.php
Add APP_LOGGING
[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         'email_confirmed' => 1
21     ];
22 });
23
24 $factory->define(BookStack\Book::class, function ($faker) {
25     return [
26         'name' => $faker->sentence,
27         'slug' => str_random(10),
28         'description' => $faker->paragraph
29     ];
30 });
31
32 $factory->define(BookStack\Chapter::class, function ($faker) {
33     return [
34         'name' => $faker->sentence,
35         'slug' => str_random(10),
36         'description' => $faker->paragraph
37     ];
38 });
39
40 $factory->define(BookStack\Page::class, function ($faker) {
41     $html = '<p>' . implode('</p>', $faker->paragraphs(5)) . '</p>';
42     return [
43         'name' => $faker->sentence,
44         'slug' => str_random(10),
45         'html' => $html,
46         'text' => strip_tags($html)
47     ];
48 });
49
50 $factory->define(BookStack\Role::class, function ($faker) {
51     return [
52         'display_name' => $faker->sentence(3),
53         'description' => $faker->sentence(10)
54     ];
55 });
56
57 $factory->define(BookStack\Tag::class, function ($faker) {
58     return [
59         'name' => $faker->city,
60         'value' => $faker->sentence(3)
61     ];
62 });
63
64 $factory->define(BookStack\Image::class, function ($faker) {
65     return [
66         'name' => $faker->slug . '.jpg',
67         'url' => $faker->url,
68         'path' => $faker->url,
69         'type' => 'gallery',
70         'uploaded_to' => 0
71     ];
72 });