2017-04-20 45 views
-1
{{ App\Like::where('post_id', $post->id)->count() }} 

我要取的具有特定POST_ID,其「喜歡」列設置爲1。我怎樣才能把一個條款行?計數數量

回答

0
{{ App\Like::where('post_id', $post->id)->where('like', 1)->count() }} 

只要把另一where