2021-10-30 16:29:59 -04:00
|
|
|
<?php
|
|
|
|
|
2023-05-24 04:06:15 -04:00
|
|
|
namespace Database\Factories\Users\Models;
|
2021-10-30 16:29:59 -04:00
|
|
|
|
2023-05-17 12:56:55 -04:00
|
|
|
use BookStack\Users\Models\User;
|
2021-10-30 16:29:59 -04:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
class UserFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2021-12-18 11:41:42 -05:00
|
|
|
protected $model = User::class;
|
2021-10-30 16:29:59 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
2023-01-21 15:50:04 -05:00
|
|
|
$name = $this->faker->name();
|
2021-10-30 16:29:59 -04:00
|
|
|
|
|
|
|
return [
|
|
|
|
'name' => $name,
|
2023-01-21 15:50:04 -05:00
|
|
|
'email' => $this->faker->email(),
|
2021-12-18 11:41:42 -05:00
|
|
|
'slug' => Str::slug($name . '-' . Str::random(5)),
|
2021-10-30 16:29:59 -04:00
|
|
|
'password' => Str::random(10),
|
|
|
|
'remember_token' => Str::random(10),
|
|
|
|
'email_confirmed' => 1,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|