feat: add desciption to category and sub category

This commit is contained in:
2026-06-03 16:07:29 +03:30
parent 0cb4954579
commit c52a234835
8 changed files with 107 additions and 7 deletions
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('categories', function (Blueprint $table) {
$table->text('description')->nullable()->after('name');
$table->string('icon')->nullable()->after('description'); // stored icon image path
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('categories', function (Blueprint $table) {
$table->dropColumn(['description', 'icon']);
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('sub_categories', function (Blueprint $table) {
$table->text('description')->nullable()->after('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('sub_categories', function (Blueprint $table) {
$table->dropColumn('description');
});
}
};