<?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('blog_posts', function (Blueprint $table) {
$table->id();
$table->string('slug', 255)->unique();
$table->string('author', 255)->default('Chandra & Sons Team');
$table->string('category', 100)->nullable();
$table->json('tags')->nullable();
$table->string('featured_image', 500)->nullable();
$table->string('title', 500);
$table->text('excerpt')->nullable();
$table->longText('content')->nullable();
$table->string('meta_title', 500)->nullable();
$table->text('meta_description')->nullable();
$table->string('og_image', 500)->nullable();
$table->enum('status', ['draft','published','scheduled'])->default('draft');
$table->timestamp('published_at')->nullable();
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('blog_posts'); }
};