Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Factories: How to create many testing records without loops

Premium
4:54

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

V
Vadim ✓ Link copied!

How long does the temp/test DB stays in the memory?

If I have hundreds of tests, refreshing DB and seeding it in the begining of EVERY test would an overload and time waste.

So, logically - once seeded, it should stay till the end of ALL tests. Right?


(Regarding Comments on this website:

single "Enter" still doesn't create a new line in the comments, need to type "Enter" twice to get text to the new line.

And I like the button "Get notified when..." - nice thing - thanks for that.)

PK
Povilas Korop ✓ Link copied!

In best scenario, every test should be individual and not dependent on other tests. That's why seeding of fake data are done SEPARATELY for every test. In every test, you should assume your DB is empty and you create a new scenario.

With Enter, not sure, it works for me on my Macbook with pressing only once, not much we can change here, as it's laravel-comments.com plugin, not created by us.

J
jasato ✓ Link copied!

Hi Povilas,

you should specify with which Laravel version you work in every course. It helps us to know which features are available or not available depending on framework version.

PK
Povilas Korop ✓ Link copied!

I agree, and I did specify it - see here below the title: https://laraveldaily.com/course/laravel-testing

Perhaps it should be more visible, but should I repeat that in every lesson? Not sure.