bigIncrements('id'); // Permanent link to the Asterisk call $table->string('linkedid', 100)->nullable()->index(); // Call context snapshot $table->string('phone_number', 50)->nullable(); $table->string('direction', 10)->nullable(); // inbound | outbound $table->dateTime('call_date')->nullable(); $table->integer('duration')->default(0); // total seconds $table->integer('talktime')->default(0); // billsec $table->integer('ringtime')->default(0); // duration - billsec // Agent-filled fields $table->string('subject', 255)->nullable(); $table->string('outcome', 100)->nullable(); $table->string('status', 100)->nullable(); // log entry status $table->string('source', 100)->nullable(); // call source / channel $table->text('notes')->nullable(); $table->date('follow_up_date')->nullable(); $table->string('follow_up_note', 255)->nullable(); // CRM links $table->unsignedInteger('lead_id')->nullable(); $table->unsignedInteger('contact_id')->nullable(); // Ownership - company resolved via user relationship (no redundant company_id) $table->unsignedBigInteger('user_id')->nullable()->index(); $table->timestamps(); }); } public function down(): void { Schema::dropIfExists('call_logs'); } };