diff --git a/database/migrations/2022_06_16_092704_add_billing_period_to_products.php b/database/migrations/2022_06_16_092704_add_billing_period_to_products.php index 4018fb47..708e6e5e 100644 --- a/database/migrations/2022_06_16_092704_add_billing_period_to_products.php +++ b/database/migrations/2022_06_16_092704_add_billing_period_to_products.php @@ -19,6 +19,14 @@ class AddBillingPeriodToProducts extends Migration }); DB::statement('UPDATE products SET billing_period="hourly"'); + + $products = DB::table('products')->get(); + foreach ($products as $product) { + $price = $product->price; + $price = $price / 30 / 24; + DB::table('products')->where('id', $product->id)->update(['price' => $price]); + } + } /**