ORM for mysql now () - Laravel 4
I have the following sql
select * from bids where deleted_at is null
and publication_date <= now() and open_date >= now()
I want to write it using ORM
$bids = Bid::where('publication_date','<=','now()')->where('open_date','>=','now()')->get();
It doesn't work then I rewrite as below
$bids=DB::select(DB::raw('select * from bids where deleted_at is null and publication_date <= now() and open_date >= now()'));
How to write above ORM query, I think that now()
poses the problem
+3
source to share