2017-09-16 27 views

回答

1

您可以在模型创建范围功能来过滤出e.g:

public function scopePlaylist($query) 
{ 
    return $query->where('is_playlist', 1); 
} 

这意味着您可以轻松调用,Content::playlist()->get(),你就会有只播放列表的内容。

我希望这有用吗?