How do I convert the following query to Laravel 4 eloquent ORM?
select * from table where ((starttime <= ? and endtime >= ?) or (starttime <= ? and endtime >= ?) or (starttime >= ? and endtime <= ?))
How do I convert the following query to Laravel 4 eloquent ORM?
select * from table where ((starttime <= ? and endtime >= ?) or (starttime <= ? and endtime >= ?) or (starttime >= ? and endtime <= ?))
Like this:
Have a look at the documentation for even more cool stuff you can do with Eloquent and the Query Builder.
//Edit: To even wrap the whole where-clause in braces (like it is in your question), you can do this: