Skip to content

Conversation

Icegreeen
Copy link
Contributor

The DatabaseSeeder used User::factory()->create() and failed when running php artisan db:seed multiple times due to the unique email constraint.

Captura de tela 2025-09-13 024751

It was updated to User::firstOrCreate() to ensure idempotency:

  • No duplicate users are created.
  • A predictable default user is always available ([email protected] / password).

Now it has no problems and does not break when running it multiple times.

Captura de tela 2025-09-13 025442

@joetannenbaum
Copy link
Contributor

Thanks!

@joetannenbaum joetannenbaum merged commit 695a12e into laravel:main Sep 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants