eav
eav copied to clipboard
How to use wthCount, withSum and so on
Hi @sunel
$organizations = OrganizationEav::withCount('comments' )->get();
withCount don't work.
Is there a solution to this problem?
error
SQLSTATE[08P01]: <<Unknown error>>: 7 ERROR: bind message supplies 11 parameters, but prepared statement "pdo_stmt_00000013" requires 13 (SQL: select (select count(*) from "comments" where "organizations"."id" = "comments"."commentable_id" and "comments"."commentable_type" = organization and "status" = PUBLISHED and "parent_id" is null) as "comments_count"
@smilelanss
Can you post the class blueprint here
@sunel
Class:
use App\EavModels\Organization as OrganizationEav;
Model:
use Eav\Model;
class Organization extends Model