mercredi 27 février 2019

Where between created_at column?

I've been struggling with date range between (single column ) created_at column, so far i tried this

$startDate = date('Y-m-d', strtotime($request->start_date));
$endDate = date('Y-m-d', strtotime($request->end_date));
....->whereBetween('created_at', [$startDate,$endDate])

created_at format is by default ( Y-m-d H:i:s ), in post data i'm getting this format ( Y-m-d )

I know it's wrong query,but how should i think ?

Do i've to use ->whereRaw() ? or something with ->whereDate ?

Please help



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire