Skip to main content

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

Read more here

Customized Factory Class

Premium
4 min read

In this lesson, let's look at an interesting example of a Factory class. I found an example on the spatie/freek.dev open-source repository, where they created a separate Factory class not in the database/factories but in tests/factories, mimicking the same behavior but with much more customized functions.


How That Factory Class is Used

The usage is similar to that of a regular Factory. New class initialization, then some type identical to how factories have states and...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (31 h 16 min)

You also get:

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

Already a member? Login here

Comments & Discussion

No comments yet…