How to get created_at date only not time in laravel 5.4

I have some more solutions:

where('created_at', '>=', date('Y-m-d').' 00:00:00'));
whereDate('created_at', '=', date('Y-m-d'));
whereDate('created_at', '=', Carbon::today()->toDateString());

It will work 100%


You can use toDateString()

{{ isset(Auth::user()->created_at) ? Auth::user()->created_at->toDateString() : Auth::user()->email }}

or format()

{{ isset(Auth::user()->created_at) ? Auth::user()->created_at->format('m/d/Y') : Auth::user()->email }}

Tags:

Sql

Php

Laravel 5