belongsToMany(Video::class,'video_tag'); } protected static function init() { self::afterDelete(function (self $tag){ VideoTag::tag($tag['id'])->delete(); }); } public function scopeHot(Query $query,$hot=1){ $query->where('is_hot',$hot); } }