PostsHistoryモデルに行がないすべての投稿(Model:Post)を返そうとしています。Laravel relationship `whereNotIn`他のテーブル
私のコードは次のとおりです。
public function posts(){
return $this->hasMany('App\Post');
}
public function remaining_posts(){
$history = PostHistory::all()->pluck('id');
return $this->posts->whereNotIn('post_id', $history);
}
しかし、私はエラー
[BadMethodCallException]
Method whereNotIn does not exist.
私は関係を通じてremaining_postsを得ることができるか、コントローラのみで行うことができますどのような方法がありますを取得しますか?
ありがとうございました:) – George