*/ protected $fillable = [ 'user_id', 'type', 'label', 'content', 'active', 'verified_at', 'preferred_time', 'verification_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'active' => 'boolean', 'verified_at' => 'datetime', 'preferred_time' => 'datetime', ]; /** * Get the user associated with the user notification channel. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this> */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the user notification sent records associated with the user * notification channel. * * @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserNotificationSent, $this> */ public function userNotificationSent(): HasMany { return $this->hasMany(UserNotificationSent::class); } /** * Get the contact reminder records associated with the user. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\ContactReminder, $this> */ public function contactReminders(): BelongsToMany { return $this->belongsToMany(ContactReminder::class, 'contact_reminder_scheduled') ->withPivot('scheduled_at', 'triggered_at') ->withTimestamps(); } }