]> BookStack Code Mirror - bookstack/blob - database/factories/Auth/UserFactory.php
Cleaned up namespacing in routes
[bookstack] / database / factories / Auth / UserFactory.php
1 <?php
2
3 namespace Database\Factories\Auth;
4
5 use BookStack\Users\Models\User;
6 use Illuminate\Database\Eloquent\Factories\Factory;
7 use Illuminate\Support\Str;
8
9 class UserFactory extends Factory
10 {
11     /**
12      * The name of the factory's corresponding model.
13      *
14      * @var string
15      */
16     protected $model = User::class;
17
18     /**
19      * Define the model's default state.
20      *
21      * @return array
22      */
23     public function definition()
24     {
25         $name = $this->faker->name();
26
27         return [
28             'name'            => $name,
29             'email'           => $this->faker->email(),
30             'slug'            => Str::slug($name . '-' . Str::random(5)),
31             'password'        => Str::random(10),
32             'remember_token'  => Str::random(10),
33             'email_confirmed' => 1,
34         ];
35     }
36 }