How to get records of two dates in a single query?
I have a has_many relationship with product_meta. Now I want to get product meta of all products but where product meta created on two dates like have 5/12/2020 and 09/12/2020. I don't want to get product meta between these two dates but I want to get product meta of only these two dates.
$data = Product::with(['productMeta' => function ($query) use ($date_1, $date_2) {
$query->ofDate($date_1, $date_2);
}])->orderBy('created_at','desc')->get();
How to improve this query to get product_meta of two specifics dates.