merge product controller with kashkool

This commit is contained in:
2026-05-25 19:42:48 +03:30
parent da9498cb51
commit 6ade379944
3 changed files with 268 additions and 79 deletions
@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddProviderFieldsToOrdersTable extends Migration
{
public function up()
{
if (!Schema::hasColumn('orders', 'provider_id')) {
Schema::table('orders', function (Blueprint $table) {
$table->unsignedBigInteger('provider_id')
->nullable()
->after('id')
->index();
});
}
if (!Schema::hasColumn('orders', 'total_price_montzar')) {
Schema::table('orders', function (Blueprint $table) {
$table->decimal('total_price_montzar', 20, 4)
->nullable()
->after('total_price');
});
}
}
public function down()
{
if (Schema::hasColumn('orders', 'total_price_montzar')) {
Schema::table('orders', function (Blueprint $table) {
$table->dropColumn('total_price_montzar');
});
}
if (Schema::hasColumn('orders', 'provider_id')) {
Schema::table('orders', function (Blueprint $table) {
$table->dropIndex(['provider_id']);
$table->dropColumn('provider_id');
});
}
}
}