sunel / eav

Entity–attribute–value model (EAV) for Laravel Artisan
https://sunel.github.io/eav/
143 stars 39 forks source link

error when using parameter grouping in query #25

Closed joaopmmartins closed 5 years ago

joaopmmartins commented 5 years ago

When I try the following query using parameter grouping :

` $type1 = 'cultivator'; $type2 = 'fork';

$products = Product::whereAttribute('garden_tool_material', '=', 'wooden') ->whereAttribute(function ( $query) use ($type1, $type2) { $query->whereAttribute('garden_tool_type', '=', $type1); $query->orWhereAttribute('garden_tool_type', '=', $type2); })->get() ->select(['attr.*']); `

I get the error:

Illegal offset type

sunel commented 5 years ago

@joaopmmartins

Can you check now i have made a fix for the issue

joaopmmartins commented 5 years ago

Sunel, many thanks for that.