🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 2026_05_14_000001_create_menus_table.php

📁 Path: //home2/skhata/new.chandrapharma.com/database/migrations/2026_05_14_000001_create_menus_table.php
📊 Size: 1.82 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->id();
            $table->string('name');                        // e.g. "Main Header", "Footer Links"
            $table->string('location')->unique();          // e.g. header, footer, footer_legal
            $table->string('description')->nullable();
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });

        Schema::create('menu_items', function (Blueprint $table) {
            $table->id();
            $table->foreignId('menu_id')->constrained()->cascadeOnDelete();
            $table->foreignId('parent_id')->nullable()->constrained('menu_items')->cascadeOnDelete();
            $table->string('label');                       // display text
            $table->string('url')->nullable();             // absolute or relative URL
            $table->string('type')->default('custom');     // custom | page | category | product
            $table->unsignedBigInteger('reference_id')->nullable(); // FK to page/category/product
            $table->string('target')->default('_self');    // _self | _blank
            $table->string('icon')->nullable();            // heroicon name (optional)
            $table->boolean('is_active')->default(true);
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->timestamps();

            $table->index(['menu_id', 'sort_order']);
            $table->index(['menu_id', 'parent_id']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('menu_items');
        Schema::dropIfExists('menus');
    }
};
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨