I have a PHP code that will display the date format which is
{{date('F d, Y', strtotime($po->due_date))}}
and it will output something like "September 02, 2016", how can I format this date into "Sep 02, 2016"?
I have a PHP code that will display the date format which is
{{date('F d, Y', strtotime($po->due_date))}}
and it will output something like "September 02, 2016", how can I format this date into "Sep 02, 2016"?
It's M d, Y
. I would recommend you to add due_date
to $dates
property in your model:
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = [
'due_date',
];
Then you can display it $po->due_date->format('M d, Y')
instead of date('M d, Y', strtotime($po->due_date))