Schema::create('posts', function (Blueprint $table) { $table->id(); $table->string('title'); $table->text('content'); $table->unsignedBigInteger('category_id'); $table->unsignedBigInteger('reporter_id')->nullable(); $table->string('image_path', 255)->nullable(); $table->enum('status', ['draft', 'published'])->default('draft'); $table->timestamps(); $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); $table->foreign('reporter_id')->references('id')->on('reporters')->onDelete('set null'); });