feat: Implement soft deletes for customer, invoice, order, and transaction models, and add customer edit and trash management to the admin panel.

This commit is contained in:
pbao9
2026-02-16 17:04:27 +07:00
parent 4dae15ffca
commit 31cbdf323f
22 changed files with 560 additions and 34 deletions
@@ -42,6 +42,7 @@ return new class extends Migration {
$table->string('remember_token', 100)->nullable();
$table->tinyInteger('status')->default(1);
$table->timestamps();
$table->softDeletes();
$table->foreign('province_code')
->references('code')
@@ -66,6 +67,6 @@ return new class extends Migration {
public function down()
{
//
Schema::dropIfExists('customer');
Schema::dropIfExists('customers');
}
};
@@ -27,6 +27,7 @@ return new class extends Migration {
$table->string('client_ip', 100)->nullable();
$table->tinyInteger('status')->default(0);
$table->timestamps();
$table->softDeletes();
});
}
@@ -31,6 +31,7 @@ return new class extends Migration {
$table->tinyInteger('status')->default(0);
$table->timestamps();
$table->softDeletes();
});
}
@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
Schema::table('customers', function (Blueprint $table) {
$table->softDeletes();
});
Schema::table('invoice', function (Blueprint $table) {
$table->softDeletes();
});
Schema::table('order', function (Blueprint $table) {
$table->softDeletes();
});
Schema::table('transaction', function (Blueprint $table) {
$table->softDeletes();
});
}
public function down()
{
Schema::table('customers', function (Blueprint $table) {
$table->dropSoftDeletes();
});
Schema::table('invoice', function (Blueprint $table) {
$table->dropSoftDeletes();
});
Schema::table('order', function (Blueprint $table) {
$table->dropSoftDeletes();
});
Schema::table('transaction', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};
@@ -0,0 +1,21 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
Schema::table('transaction', function (Blueprint $table) {
$table->softDeletes();
});
}
public function down()
{
Schema::table('transaction', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};