| @@ -224,11 +224,24 @@ | ||
| 224 | 224 | return $this->belongsToMany(Course::class, 'fcom_space_user', 'user_id', 'space_id') |
| 225 | 225 | ->withPivot([ 'role', 'created_at' ]); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | + /** | |
| 229 | + * @deprecated 2.8.2 Use notificationPreferences() - preferences no longer live | |
| 230 | + * in fcom_notification_users. | |
| 231 | + */ | |
| 228 | 232 | public function notificationSubscriptions() |
| 229 | 233 | { |
| 230 | 234 | return $this->hasMany(NotificationSubscription::class, 'user_id'); |
| 235 | + } | |
| 236 | + | |
| 237 | + /** | |
| 238 | + * Explicit notification preference overrides across every channel. | |
| 239 | + * Recipient selection for email fan-outs is driven off this relation. | |
| 240 | + */ | |
| 241 | + public function notificationPreferences() | |
| 242 | + { | |
| 243 | + return $this->hasMany(NotificationPreference::class, 'user_id', 'ID'); | |
| 231 | 244 | } |
| 232 | 245 | |
| 233 | 246 | public function space_pivot() |
| 234 | 247 | { |