24 lines
647 B
PHP
24 lines
647 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Videos extends Model
|
|
{
|
|
public function comments(): \Illuminate\Database\Eloquent\Relations\HasMany
|
|
{
|
|
return $this->hasMany(VideoComments::class, "aid", "id");
|
|
}
|
|
|
|
public function programs(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
|
{
|
|
return $this->hasManyThrough(Programs::class, ProgramVideos::class, "video_bvid", "bvid", "id", "program_id");
|
|
}
|
|
|
|
public function danmakus(): \Illuminate\Database\Eloquent\Relations\HasMany
|
|
{
|
|
return $this->hasMany(VideoDanmakus::class, "video_bvid", "bvid");
|
|
}
|
|
}
|