/** * Create the sub charge for each member, only do this for members with dates matching the supplied date * * @param Carbon $targetDate */ public function createSubscriptionCharges($targetDate) { $users = $this->userRepository->getBillableActive(); foreach ($users as $user) { if ($user->payment_day == $targetDate->day && !$this->subscriptionChargeRepository->chargeExists($user->id, $targetDate)) { $this->subscriptionChargeRepository->createCharge($user->id, $targetDate); } } }