lundi 16 août 2021

Filter record through dates not working laravel

I have a expiry_date (type=date) column in my table

$currentDate = date('Y-m-d');
$Data = Post::whereDate('expiry_date','<=',$currentDate)->where(['status' => 'active'])->orWhere(['p_id' => 3])->select('id','title','status','p_id','expiry_date')->orderBy('id', 'DESC')->get();

i want to filter data if current date is greater than expiry date then those record should not be shown but in my scenario i'm still getting record.

Any solution Thanks.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UmmjGl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire