I want a Database Query like this in query builder:
SELECT * FROM posts WHERE active = 1 AND published <= '{$now}' LIMIT 5
What I made:
$now = new Carbon;
$feed = Post::where([
['active' => 1],
['published' => $now]
])
-> take(5)
-> get()
-> toArray();
But it's like:
SELECT * FROM posts WHERE active = 1 AND published = '{$now}' LIMIT 5
How to make <, <=, >, >=, <> and LIKE statements with ::where method?