mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 15:42:41 +01:00
78ebcb6f38
Closes #3969
37 lines
823 B
PHP
37 lines
823 B
PHP
<?php
|
|
|
|
namespace Database\Factories\Auth;
|
|
|
|
use BookStack\Auth\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class UserFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = User::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
$name = $this->faker->name();
|
|
|
|
return [
|
|
'name' => $name,
|
|
'email' => $this->faker->email(),
|
|
'slug' => Str::slug($name . '-' . Str::random(5)),
|
|
'password' => Str::random(10),
|
|
'remember_token' => Str::random(10),
|
|
'email_confirmed' => 1,
|
|
];
|
|
}
|
|
}
|