Edit File: 2021_08_17_174312_create_contacts_table.php
<?php use App\Enums\ContactType; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateContactsTable extends Migration { public function up() { Schema::create('contacts', function (Blueprint $table) { $table->id(); $table->nullableMorphs('contactable'); $table->string('name',50)->nullable(); $table->string('phone',20)->nullable(); $table->string('email',50)->nullable(); $table->string('country_code')->nullable(); $table->string('title',100)->nullable(); $table->longText('message',500)->nullable(); $table->string('image')->nullable(); $table->enum('type', ContactType::values())->default(ContactType::COMPLAINT); $table->timestamps(); }); } public function down() { Schema::dropIfExists('contacts'); } }
Back to File Manager