id(); $table->foreignId('category_id')->constrained()->restrictOnDelete(); $table->string('title'); $table->text('description')->nullable(); $table->string('status')->default('draft'); // status: draft | processing | active | inactive | failed $table->boolean('is_active')->default(false); $table->date('effective_date')->nullable(); // tarikh kuat kuasa $table->date('expiry_date')->nullable(); // tarikh luput (optional) $table->json('tags')->nullable(); // ["lesen", "perniagaan"] $table->string('language', 10)->default('ms'); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); $table->softDeletes(); $table->index(['category_id', 'is_active']); $table->index('status'); }); } public function down(): void { Schema::dropIfExists('documents'); } };