試してみるとどうなりますか ->where('p.name IN (:pids)') // error is HERE parenthesesを期待していることを明示的に示しています ただし、placeholderを取得します