where( DB::raw( 'DATE(created_at)' ), Carbon\Carbon::now()->toDateString())
or with db function like:
whereRaw( 'DATE(created_at) = CURRENT_DATE')
EDIT: Carbon has one more handy function for you: today()
, so the first code might look like:
where( DB::raw( 'DATE(created_at)' ), Carbon\Carbon::today() )
I have one more dought, How to get the time of stored column, Means i want to delete the entry which has stored one hour back. Thank you for help
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community