Custom validation rule , check if date range is already taken or not

Published

I have to manage the reservation for the rental of a house, when I make a new reservation the start date and the end date should be free.

For example, if I make a reservation for a client from September 23 to September 28, I cannot create another reservation over this date.
I would need an eloquent query that could check that started_at and ends_at (of the form) are not included between the already existing dates

Source: Laravel

Published
Categorised as eloquent, laravel Tagged ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq