Finding records that have a date range, using a single date
I have a database with two fields that are dates.
A start field.
A end field.
If the date I am using to search is 2019-8-10, what would the query look like in Laravel to find all records whose start and end are either on, or between this date?
In general the query is the other way around right? You have a start and end date in your input that you use check if a date is available in the given period.
Anyway, in general date queries are really easy in Laravel to do. In your case that might look like this
I started with pretty much exactly as you suggesed, but I did not get the results I should have. Later I found that I needed to do the reverse with the where clause, so this is what I did: