skip to Main Content

Where Year In list of years Laravel

What I want to do is something like this : $listOfYears = Invoice::pluck('year') ; // [ 2001, 2002, 2003 ] $products = Product::whereYearIn('purchase_date',$listOfYears)->get(); the field purchase_date is type date so you can't just use whereIn, you need to apply whereYear…

VIEW QUESTION
Back To Top
Search