id(); $table->foreignId('company_id')->constrained()->cascadeOnDelete(); $table->foreignId('parent_address_id')->nullable()->constrained('addresses')->nullOnDelete(); $table->morphs('addressable'); $table->string('type'); // billing, shipping, etc. $table->string('recipient')->nullable(); $table->string('phone')->nullable(); $table->string('address_line_1'); $table->string('address_line_2')->nullable(); $table->string('city'); $table->smallInteger('state_id')->nullable(); $table->string('postal_code')->nullable(); $table->string('country')->nullable(); $table->text('notes')->nullable(); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('addresses'); } };