filterable() doesn't include table name = Column 'xxx' in where clause is ambiguous #5229
-
Description:When using the filterable() on a field the SQL generated doesn't include the table name. This triggers an 'SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'xxx' in where clause is ambiguous' when an inners join is applied through the indexQuery(). Example:
Returns (when applying a filter) SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous;
When replacing DATE( |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You need to manually define filterable callback: https://nova.laravel.com/docs/4.0/resources/fields.html#filterable-fields |
Beta Was this translation helpful? Give feedback.
-
How did you get it to work with the 'FROM' and 'TO' inputs that a user can filter with? These 2 filter inputs are automatically created by Nova 4 when using
The above will only work for the 'FROM' date, but how can I tell if the user is choose the 'TO' date? |
Beta Was this translation helpful? Give feedback.
You need to manually define filterable callback: https://nova.laravel.com/docs/4.0/resources/fields.html#filterable-fields