2023_05_11_092445_create_contact_infos_table.php
1 <?php 2 3 use Illuminate\Database\Migrations\Migration; 4 use Illuminate\Database\Schema\Blueprint; 5 use Illuminate\Support\Facades\Schema; 6 7 return new class extends Migration 8 { 9 public function up(): void 10 { 11 Schema::create('contact_infos', function (Blueprint $table) { 12 $table->id(); 13 $table->string('address',1000); 14 $table->string('city')->nullable(); 15 $table->string('postal_code')->nullable(); 16 $table->string('phone'); 17 $table->string('email')->nullable(); 18 $table->foreignIdFor(\App\Models\Country::class)->nullable(); 19 $table->morphs('contactable'); 20 $table->timestamps(); 21 }); 22 } 23 24 public function down(): void 25 { 26 Schema::dropIfExists('contact_infos'); 27 } 28 };