'integer', 'activity_id' => 'integer', 'news_id' => 'integer', 'sort' => 'integer', 'status' => 'integer', ]; public function course(): BelongsTo { return $this->belongsTo(Course::class); } public function activity(): BelongsTo { return $this->belongsTo(Activity::class); } public function news(): BelongsTo { return $this->belongsTo(News::class); } public static function typeLabel(string $type): string { return match ($type) { self::TYPE_COURSE => '课程', self::TYPE_ACTIVITY => '活动', self::TYPE_NEWS => '资讯', self::TYPE_CUSTOM => '自定义', default => $type, }; } }