44 خطوط
938 B
PHP
44 خطوط
938 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class FollowUp extends Model
|
|
{
|
|
protected $fillable = [
|
|
'lead_id', 'user_id', 'created_by', 'call_id', 'source', 'scheduled_at',
|
|
'completed_at', 'notes', 'status', 'is_overdue',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'scheduled_at' => 'datetime',
|
|
'completed_at' => 'datetime',
|
|
'is_overdue' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function lead(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Lead::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function call(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Call::class);
|
|
}
|
|
}
|