How to retrieve today registered data from Database using Laravel

Code example to retrieve today data:

$result = array();
$today = date('Y-m-d', time()); //get today date

$result = DB::table('customer')
	      ->where('status', 1)
	      ->whereRaw(DB::raw("DATE(created_at) = '".$today."'"))
	      ->get();

print '<pre>'; print_r($result); //print result

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *