How to change default format at created_at and updated_at value laravel
In your Post model add two accessor methods like this: public function getCreatedAtAttribute($date) { return Carbon\Carbon::createFromFormat(‘Y-m-d H:i:s’, $date)->format(‘Y-m-d’); } public function getUpdatedAtAttribute($date) { return Carbon\Carbon::createFromFormat(‘Y-m-d H:i:s’, $date)->format(‘Y-m-d’); } Now every time you use these properties from your model to show a date these will be presented differently, just the date without the time, for example: … Read more