2017-09-16 40 views

回答

1

您可以在模型創建範圍功能來過濾出e.g:

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

這意味着您可以輕鬆調用,Content::playlist()->get(),你就會有隻播放列表的內容。

我希望這有用嗎?