hasMany(LearningPathVersion::class); } public function latestVersion(): HasOne { return $this->hasOne(LearningPathVersion::class)->ofMany('version_number', 'max'); } public function creator(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } }