id(); $table->string('code')->unique(); $table->string('modality')->nullable(); $table->string('status')->default(DocumentStatusEnum::Registered->value); $table->string('priority')->default(DocumentPriorityEnum::Medium->value); $table->text('note')->nullable(); $table->timestamp('submitted_at')->nullable(); $table->timestamp('scan_date')->nullable(); $table->timestamp('processing_deadline')->nullable(); $table->timestamp('finalized_at')->nullable(); $table->foreignId('finalized_by')->nullable()->constrained('users')->cascadeOnDelete(); $table->text('rejection_reason')->nullable(); $table->timestamps(); $table->softDeletes(); $table->foreignId('pet_id')->constrained('pets')->cascadeOnDelete(); $table->foreignId('requester_id')->constrained('users')->cascadeOnDelete(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('documents'); } };