How to get One Day Old Records in Laravel using Carbon?

  2158 views   1 year ago Laravel

In this article, I will share with you how to get one day old records in laravel using carbon. just follow simple example.

$getUserOneDayOld = \DB::table('users')
    ->where('is_delete', '0')
    ->where('status', '1')
    ->whereBetween('created_at', array(\Carbon\Carbon::now()->subDays(1)->toDateTimeString(), \Carbon\Carbon::now()

i hope it will be help you.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]