mercredi 25 septembre 2019

Query last one year - Laravel 5.8

I'm trying to query all my visitor for the last one year.

I've tried

$raw = Visitor
           ::whereDate('created_at','>', Carbon::now()->year-1)
           ->get()
           ->pluck('created_at');

Note:

Carbon::now()->year-1 //-------------> 2018

I keep getting all the vsiitors in my db.

What did I do wrong ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire