purityselect/app/Models/Appointment.php
2024-10-25 01:05:27 +05:00

48 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Appointment extends Model
{
protected $table = "appointments";
protected $fillable = [
'telemed_pros_id',
'patient_id',
'appointment_time',
'in_call',
'meeting_id',
'agent_call_token',
'patient_call_token',
'video_token',
'appointment_date',
'patient_email',
'patient_name',
'timezone',
'analytics',
'start_time',
'end_time',
'duration',
'status'
];
public function telemedPro()
{
return $this->belongsTo(Telemedpro::class, 'telemed_pros_id', 'id');
}
public function patient()
{
return $this->belongsTo(Patient::class, 'patient_id', 'id');
}
public function getMeetingCountAttribute()
{
return $this->appointments()->count();
}
public function cart()
{
return $this->hasOne(Cart::class);
}
}