belongsTo(TimelineYear::class, 'year_id'); } public function scopePublished($query) { return $query->where('status', 'publish'); } public function scopeOrdered($query) { return $query->orderBy('sort'); } public function scopeOfType($query, string $type) { return $query->where('type', $type); } }