diff --git a/app/Models/VideoParts.php b/app/Models/VideoParts.php new file mode 100644 index 0000000..025cd44 --- /dev/null +++ b/app/Models/VideoParts.php @@ -0,0 +1,14 @@ +belongsTo(Videos::class, "bvid", "bvid"); + } +} diff --git a/app/Models/Videos.php b/app/Models/Videos.php index 30220af..575b835 100644 --- a/app/Models/Videos.php +++ b/app/Models/Videos.php @@ -41,4 +41,9 @@ class Videos extends Model { return $this->danmakus()->where("platform_id", "=", 3); } + + public function parts(): \Illuminate\Database\Eloquent\Relations\HasMany + { + return $this->hasMany(VideoParts::class, "bvid", "bvid"); + } }