To convert the UTC time to an arbitrary timezone, you can use the setTimezone() method provided by the Carbon library. Here's an example of how you can modify the code to convert the UTC time to EST:
$base_date = Carbon::yesterday('UTC')->setTimezone('America/New_York');
$start_date = $base_date->startOfDay()->toDateTimeString();
$end_date = $base_date->endOfDay()->toDateTimeString();
$orders = Order::where('completed_at', '>=', $start_date)->where('completed_at', '<=', $end_date)->count();
In this example, we first create a Carbon instance for yesterday in the UTC timezone. We then use the setTimezone() method to convert it to the EST timezone. Finally, we use the converted date to filter the orders.