<?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::create('contacts', function (Blueprint $table) {
        $table->id();
        
        // Informasi Utama
        $table->string('title'); // Contact Us
        $table->text('subtitle')->nullable();
        
        // Detail Kontak
        $table->text('address')->nullable();
        $table->string('phone')->nullable();
        $table->string('whatsapp')->nullable();
        $table->string('email')->nullable();
        $table->string('working_hours')->nullable();
        
        // Map & Media
        $table->longText('google_maps_embed')->nullable(); // Buat nyimpen iframe
        $table->string('image')->nullable();
        
        // SEO (Disimpan dalam bentuk JSON)
        $table->json('seo')->nullable(); 

        $table->boolean('is_active')->default(true);
        
        // Audit Columns
        $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
        $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
        
        $table->timestamps();
    });
}

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('contacts');
    }
};
