in bfilter when i add id in my relation "message": "SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous (SQL: select count(*) as aggregate from `packages` where `client_app_id` = 0 and (exists (select * from `categories` inner join `categorizables` on `categories`.`id` = `categorizables`.`category_id` where `packages`.`id` = `categorizables`.`categorizable_id` and `categorizables`.`categorizable_type` = App\\Models\\Package and `id` = 21 and `categories`.`deleted_at` is null)) and `packages`.`deleted_at` is null)", #22
I have a relation between package Model and Categories Table with Categorizable relation
after that, I added this migration
after that this filter broken:
https://debug.behaminplus.ir/survey-service/api/v1/packages/templates?filter=%7B%22filters%22%3A%5B%5B%7B%22field%22%3A%20%22category_id%22,%20%22op%22%3A%20%22%3D%22,%20%22value%22%3A21%7D%5D%5D%7D
{"filters":[[{"field": "category_id", "op": "=", "value":21}]]}
/api/v1/packages/templates?filter={"filters":[[{"field": "category_id", "op": "=", "value":21}]]}
error is this
"message": "SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous (SQL: select count(*) as aggregate from
packageswhere
client_app_id= 0 and (exists (select * from
categoriesinner join
categorizableson
categories.
id=
categorizables.
category_idwhere
packages.
id=
categorizables.
categorizable_idand
categorizables.
categorizable_type= App\\Models\\Package and
id= 21 and
categories.
deleted_atis null)) and
packages.
deleted_atis null)",