Hello everyone, I'm currently facing some issues while trying to seed my User model using factories. Despite having the 'password' column defined in my UserFactory, I'm still receiving a "SQLSTATE[HY000]: General error: 1364 Field 'password' doesn't have a default value" error when I run the db:seed command.
Here's my UserFactory definition:
protected $model = User::class;
public function definition()
{
return [
'name' => $this->faker->name,
'email' => $this->faker->unique()->safeEmail,
'password' => Hash::make('password88'),
// ...
];
}
protected function initialize()
{
parent::initialize();
$this->faker->locale('en_AU');
}
And my UserSeeder class:
public function run()
{
User::factory(50)->create();
}
I've also set the 'name' and 'email' columns to nullable in the migration file, but the issue persists. Any help would be greatly appreciated!
Thank you.