Closed thecyrilcril closed 2 years ago
here is my solution (requires some adoption):
// get type of attribute through the entity
$attribute = app('rinvex.attributes.attribute')::whereSlug($attributeSlug)
->whereHas('entities', function ($query) use ($class) {
$query->where('entity_type', '=', $class);
})
->first();
$attributeClass = \Rinvex\Attributes\Models\Attribute::getTypeModel($attribute->type);
$distinctValues = $attributeClass::select('content')->whereAttributeId($attribute->id)->distinct()->get()->pluck('content')->toArray();
Seems to be solved, thank you @cord for your help.
I would like to list out all of my attributes and values so I can use them for filtering the entity. how do I achieve that?