VU
Attribute::query()
->with('property')
->whereHas('products', function($q) use ($productsId) {
$q->whereIn('products.id', $productsId);
)
->get(['id', 'property_id']);
Size: a a a
VU
Attribute::query()
->with('property')
->whereHas('products', function($q) use ($productsId) {
$q->whereIn('products.id', $productsId);
)
->get(['id', 'property_id']);
SG
VU
SG
SG
Attribute::query()
->distinct()
->join('properties', 'attributes.property_id', 'properties.id')
->whereHas('products', function($q) use ($productsId) {
$q->whereIn('products.id', $productsId);
)
->get(['id', 'properties.id as propery_id', 'properties.title']);
VU
Attribute::query()
->distinct()
->join('properties', 'attributes.property_id', 'properties.id')
->whereHas('products', function($q) use ($productsId) {
$q->whereIn('products.id', $productsId);
)
->get(['id', 'properties.id as propery_id', 'properties.title']);
VL
А
А
KN
ЕР
KN
A
ЕР
KN
A
A