2023-06-21 09:53:21 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
use Illuminate\Support\Str;
|
2023-07-29 02:05:43 -04:00
|
|
|
use Illuminate\Support\Facades\Hash;
|
2023-08-22 17:04:37 -04:00
|
|
|
use App\Models\Artist;
|
|
|
|
use App\Models\Artwork;
|
|
|
|
use App\Models\Episode;
|
|
|
|
use App\Models\Podcast;
|
|
|
|
use App\Models\Overlay;
|
|
|
|
use App\Models\User;
|
|
|
|
|
2023-06-21 09:53:21 -04:00
|
|
|
|
|
|
|
class UserFactory extends Factory
|
|
|
|
{
|
2023-08-22 17:04:37 -04:00
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = User::class;
|
2023-06-21 09:53:21 -04:00
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
2023-07-29 02:05:43 -04:00
|
|
|
$password = Hash::make(Str::random(rand(8, 16)));
|
2023-06-21 09:53:21 -04:00
|
|
|
return [
|
|
|
|
'name' => $this->faker->name(),
|
|
|
|
'email' => $this->faker->unique()->safeEmail(),
|
|
|
|
'email_verified_at' => now(),
|
2023-07-29 02:05:43 -04:00
|
|
|
'password' => $password,
|
2023-06-21 09:53:21 -04:00
|
|
|
'remember_token' => Str::random(10),
|
2023-12-10 16:10:32 -05:00
|
|
|
'legacy_id' => null,
|
2023-06-21 09:53:21 -04:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicate that the model's email address should be unverified.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
|
|
|
*/
|
|
|
|
public function unverified()
|
|
|
|
{
|
|
|
|
return $this->state(function (array $attributes) {
|
|
|
|
return [
|
|
|
|
'email_verified_at' => null,
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|