Now, let's try to show the property and apartment information in the search results, similarly to how it's done on the Booking.com website:

As you can see, every apartment may have its type, size in square meters, number of small/large/sofa beds, and number of bedrooms, living rooms, and bathrooms. So let's return all of that.
Goals of This Lesson
- Create DB structure for Apartment Type and size
- Create DB structure for Rooms and Beds with Bed Types
- Showing Rooms and Beds in Search Results
- Look at a different project scenario: doctors/patients
By the end of this lesson, we will have this DB structure:

DB Structure: Apartment Type and Size
Let's add two fields to the apartments: their type and size (in square meters).
Types should have a separate DB table, with a relationship, so we do exactly that...
Great 👍🌹
Thanks, I really like the tutorials so far. But I have one question. What is the benefit of creating tables like bed_types instead of creating a simple enum BedType and defining a cast for it?
Good question, enum is also possible. But saving data in the DB makes it more flexible for future users to add more bed types (via adminpanel, for example), without asking developers to change it in the code.
Thanks!
I think it is nice to add seeder so that we can also see the same results when calling postman