vendredi 27 novembre 2015

Get record from database inserted in last two hour [Laravel 5.1]

i want to get all the record from the database inserted in last two hours in Laravel 5.1, i am able to get the record for last 1 hour by using the following code,

$all_bridal_requests_check2 = \DB::table('bridal_requests')
                    ->where(function($query)
                    {
                        $query->where('publisher', '=', 'bq-quotes.sb.com')
                              ->orWhere('publisher', '=', 'bq-wd.com-bsf');
                    })
                    ->where('created_on', '>=', \Carbon\Carbon::now()->subHour())
                    ->orderBy('created_on', 'desc')
                    ->get();

But don't know how to do the same for 2 hours.

Please help me to sort out this issue.
Thanks..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire