👁 查看:2026_07_17_171145_create_menu_items_table.php
路径:/home/boguraj1/.trash/database.1/migrations/2026_07_17_171145_create_menu_items_table.php
大小:1.32 KB · 修改:2026-07-17 23:12:08 · 权限:0644 · 可写
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateMenuItemsTable extends Migration
{
public function up()
{
Schema::create('menu_items', function (Blueprint $table) {
$table->id();
$table->string('label');
$table->string('url');
$table->unsignedTinyInteger('sort_order')->default(0);
$table->boolean('is_active')->default(true);
$table->string('target')->default('_self');
$table->timestamps();
});
DB::table('menu_items')->insert([
['label' => 'হোম', 'url' => '/', 'sort_order' => 1, 'is_active' => 1, 'target' => '_self', 'created_at' => now(), 'updated_at' => now()],
['label' => 'যোগাযোগ', 'url' => '/contact', 'sort_order' => 2, 'is_active' => 1, 'target' => '_self', 'created_at' => now(), 'updated_at' => now()],
['label' => 'বিজ্ঞাপন মূল্য', 'url' => '/advertisement', 'sort_order' => 3, 'is_active' => 1, 'target' => '_self', 'created_at' => now(), 'updated_at' => now()],
]);
}
public function down()
{
Schema::dropIfExists('menu_items');
}
}