Summer Sale! All accounts are 50% off this week.

slouma's avatar

Using Event:fake() in tests prevents UUID creation

Event::fake(); $user = User::factory()->create([ 'email_verified_at' => null, ]); fails : SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: users.id

0 likes
1 reply
tisuchi's avatar

@slouma I think you need to remove Event::fake().

Or if you really want to use Event::fake() then you need to create UUID for user manually.

Please or to participate in this conversation.