<?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('page_contents', function (Blueprint $table) {
            $table->id();
            $table->string('page');        // e.g. "about", "homepage", "faq"
            $table->string('key');         // e.g. "hero_title", "hero_subtitle"
            $table->longText('value')->nullable();
            $table->string('type')->default('text'); // text, html, json
            $table->timestamps();

            $table->unique(['page', 'key']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('page_contents');
    }
};
