id(); $table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete(); $table->foreignId('user_id')->nullable()->constrained()->nullOnDelete(); $table->morphs('attachable'); $table->string('file_name'); $table->string('file_path'); $table->string('mime_type')->nullable(); $table->unsignedBigInteger('file_size')->default(0); $table->string('category')->default('receipt'); // receipt, document, photo, other $table->text('description')->nullable(); $table->timestamps(); $table->softDeletes(); $table->index(['tenant_id', 'attachable_type', 'attachable_id']); }); } public function down(): void { Schema::dropIfExists('attachments'); } };