*/ protected $fillable = [ 'email', 'password', 'address', 'city', 'state', 'zip_code', 'lat', 'long', 'dob', 'recording_switch', 'country', "first_name", "last_name", "phone_no", "shipping_address", "shipping_city", "shipping_state", "shipping_country", "shipping_zipcode", "timezone", "gender", "marital_status", "height", "weight", 'profile_picture' ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; protected $dates = ['deleted_at']; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; protected $table = "patients"; public function routeNotificationForMail($notification) { echo "asked email "; // Replace 'email_address' with the actual column name in your table return $this->email; } public function getProfileCompletionPercentageAttribute() { $activitiesCount = PatientRegActivity::where('patient_id', $this->id)->count(); switch ($activitiesCount) { case 0: return 0; case 1: return 25; case 2: return 50; case 3: return 75; default: return 100; } } }