string('billing_period')->default("hourly"); }); 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]); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('products', function (Blueprint $table) { $table->dropColumn('billing_period'); }); } }