'boolean', 'is_remote' => 'boolean', 'settings' => 'array', ]; protected static function boot() { parent::boot(); // } public function calendar(): BelongsTo { return $this->belongsTo(Calendar::class, 'calendar_id'); } /** * Upsert meta for a remote-feed subscription. */ public static function forSubscription(Subscription $sub): self { return static::updateOrCreate( // ---- unique match-key (subscription_id is unique, nullable) ---- ['subscription_id' => $sub->id], // ---- columns to fill / update ---- [ 'title' => $sub->displayname, 'color' => $sub->calendarcolor ?? '#1a1a1a', 'color_fg' => contrast_text_color($sub->calendarcolor ?? '#1a1a1a'), 'is_shared' => true, 'is_remote' => true, // mirror_calendar_id is set later by the sync-job once the // shadow “mirror” calendar has been created. ], ); } }