belongsTo(User::class); } /** * Optional: link to billing accounts where this parent is primary. */ public function billingAccounts() { return $this->hasMany(BillingAccount::class, 'primary_parent_user_id', 'user_id'); } public function students(): BelongsToMany { return $this->belongsToMany( StudentProfile::class, 'parent_student', 'parent_profile_id', // this model's FK on the pivot 'student_profile_id' // related model's FK on the pivot ) ->withPivot('relationship', 'notes') ->withTimestamps(); } public function parentProfile(): HasOne { return $this->hasOne(ParentProfile::class); } }