where('created_at', '=', date('Y-m-d')); code example

Example 1: where('created_at', '=', date('Y-m-d'));

$q->whereDate('created_at', '=', date('Y-m-d'));

Example 2: where('created_at', '=', date('Y-m-d'));

$q->whereDay('created_at', '=', date('d'));
$q->whereMonth('created_at', '=', date('m'));
$q->whereYear('created_at', '=', date('Y'));

Example 3: where('created_at', '=', date('Y-m-d'));

$q->where('created_at', '>=', date('Y-m-d').' 00:00:00'));

Example 4: where('created_at', '=', date('Y-m-d'));

$q->where(DB::raw("DATE(created_at) = '".date('Y-m-d')."'"));

Tags:

Php Example