Only until Jan 16th: coupon RESOLUTION25 for 40% off Yearly/Lifetime membership!

Read more here
Courses

Re-creating Booking.com API with Laravel and PHPUnit

While reviewing our tests, I decided we can improve things a bit, by using factories more to have more reusable and shorter code in tests. Let's do exactly that, in this short lesson.

Example:

// Current
$owner = User::factory()->create(['role_id' => Role::ROLE_OWNER]);
 
// Replacing with Factory States
$owner = User::factory()->owner()->create();

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 69 courses (1205 lessons, 45 h 02 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord