Reuse or Clone query
Typically, we need to query multiple time from a filtered query. So, most of the time we use query() method,let's write a query for getting today created active and inactive products$query = Product::query();$today = request()->q_date ?? today();if($today){$query->where('created_at', $today);}// lets get active and inactive products$active_products =...
Read more...