samedi 23 avril 2016

Select from table where updated_at + 15minutes <= this_datetime

Hello I am seaching for a solution in Laravel 5 (eloquent) to select records form a table where updated_at + 15 minutes <= today (actual datetime).

I try this solution but it does not work :

$albums = Album::with(array('pictures' => function($q){
            $q->whereDate('updated_at','<=', date("Y-m-d H:i:s", time() - (15*60)));
        }))->get();

The result look always empty

dd($albums->pictures)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire