DatabaseSeeder.php use WithoutModelEvents; by default cause all seeder has no default value error in database level
#57522
Unanswered
tommy66374
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
User model
Before this change laravel/laravel@b45fe69 seed data without define
slugin factory, because event generated the slug, and write one test assert factory created the slugAfter
use WithoutModelEvents;enabled by default, we need define slug in factory, and need another test that without use factory to ensure slug is generatedIf we want use
User::insert($data), we can useWithoutModelEventsin each generated seeder?Beta Was this translation helpful? Give feedback.
All reactions