Setting up custom date format

By default it is defined as 'Y-m-d H:i:s' and in order to use different date format we can use following snippet

// In model
protected $dateFormat = 'd-m-Y H:i:s'; // default is Y-m-d H:i:s

Related Posts


Changing timestamp field names

Using fillable or guarded