40 خطوط
857 B
PHP
40 خطوط
857 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class CallLog extends Model
|
|
{
|
|
protected $fillable = [
|
|
'lead_id', 'contact_id', 'contact_phone_id', 'call_id',
|
|
'user_id', 'called_at', 'result', 'notes', 'next_action', 'recording_url',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['called_at' => 'datetime'];
|
|
}
|
|
|
|
public function lead(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Lead::class);
|
|
}
|
|
|
|
public function contact(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Contact::class);
|
|
}
|
|
|
|
public function phone(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ContactPhone::class, 'contact_phone_id');
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|