Support the ongoing development of Laravel.io →
Database Eloquent Laravel.io

I am building a Hotel Booking App and i got stuck with filtering a hotel and rooms while inserting a checkin and check out dates

Here is my table structure

hotels

id name logo name

rooms

id 
hotel_id 
name price 
no_of_rooms

Now i have build a booking table like this

booking

id hotel_id room_id check-in checkout

i want to select a hotel and filter all the available rooms in that hotel comparing the check in and checkout dates

AND i want to filter all the rooms available in all the hotels within that check-in and checkout dates

your help would be so much appreciated and please do help me with my database structure and do suggest me the logic to build this functionality.

Last updated 3 years ago.
0

Use pivot tables

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Finsok333 finsok333 Joined 23 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.