Multiple where queries, using orWhere, in fields of model and related models
问题 I have many tables (user facing, not SQL) with filter boxes per column. The columns have not only the tables' fields but fields of related models. I'm trying to add a feature where one can use a comma as an OR separator when filtering data. I need to do it generally as I have a rather large amount of tables, fields and relations. Plus some tables are built dynamically. The code that adds the where clauses for the models own fields is this: foreach ($filters as $column => $filter) { $q->where