How to use multiple where and orwhere in Laravel Eloquent?

I am trying to build a MySQL query with multiple where and orwhere conditions, but it’s not working. I am trying to filter posts where I want to check author_id and language. The problem arises with the search option. I want to search the post_title and post_content.

Post::where('author_id', '=', $user_id)
->where('language' ,'=', 'en')
->where('post_title', 'LIKE', '%' . $keyword . '%')
->orWhere('post_content', 'LIKE', '%' . $keyword . '%')
->get();

From my understanding, when I am using the orwhere it breaks my whole logic. So how do I build nested orwhere queries?

Why don’t you put your orwhere inside where condition?

Post::where('author_id', '=', $user_id)
->where('language' ,'=', 'en')
->where(function($query) use ($keyword){
    $query->where('post_title', 'LIKE', '%' . $keyword . '%');
    $query->orWhere('post_content', 'LIKE', '%' . $keyword . '%');
})
->get();