Courses

Re-creating Booking.com API with Laravel and PHPUnit

Time to actually start booking properties. But first, how much would they cost? Let's introduce the pricing structure.

To be honest, if we try to implement all possible pricing features from Booking.com, that alone would take weeks to write/read: various "genius levels" for discounts, different prices per guest, etc.

So let's focus on the core functionality: pricing per calendar days. Typically, some resorts would cost more in July than in January, so let's work on modeling exactly that.


Goals of This Lesson

  • Prices DB structure
  • Showing prices in search results
  • Filter by price range
  • Automated test for pricing

By the end of this lesson, we will have this price calculated and shown in Postman:


Prices DB Structure

We will attach the price not to the property but to the Apartment level. The apartment may have many prices, depending on dates, so here's our DB structure for it:...

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

You also get:

  • 68 courses (1188 lessons, 43 h 18 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord