2021-10-30 16:29:59 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories\Auth;
|
|
|
|
|
2021-12-18 11:41:42 -05:00
|
|
|
use BookStack\Auth\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()
|
|
|
|
{
|
|
|
|
$name = $this->faker->name;
|
|
|
|
|
|
|
|
return [
|
|
|
|
'name' => $name,
|
|
|
|
'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,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|