How to make date string to date object in PHP using Carbon?
$minTime = DB::table('order')
->select('order_creation_date', 'restaurant_id')
->where('restaurant_id', '=', '70')
->orderBy('order_creation_date', 'asc')
->first();
$m = $orderDay -> month;
$d = $orderDay -> day;
$y = $orderDay -> year;
$y = (int)$y;
$d = (int)$d;
$m = (int)$m;
$orderDay = $minTime -> order_creation_date;
var_dump($orderDay);
Error:
Trying to get property of non-object
Normal Value of string:
string(19) "2016-02-05 14:51:30"
Any ideas how to fix it? I think I need make string to date object. Thank you.