*/ protected $table = "telemed_pros"; protected $fillable = [ 'name', 'first_name', 'last_name', 'email', 'password', 'is_busy', 'recording_switch', "ai_switch", "status", "practice_state", "phone_number", "gender", "specialty", "home_address", "medical_license_number", "years_of_experience", "email_verification", "city", "state", "zip_code", "availability_to", "availability_from" ]; protected $hidden = [ 'password', 'remember_token', ]; protected $casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', /* 'state' => 'array', */ ]; public function appointments() { return $this->hasMany(Appointment::class, 'telemed_pros_id'); } public function getMeetingCountAttribute() { return $this->appointments() ->whereHas('cart', function ($query) { $query->whereNotNull('appointment_id'); }) ->count(); } }