Hi, I have relation like this:
Category hasMany Products
Category hasMany Features
and also
Product belongsToMany Features (m2m relation)
I would like to display in backend page of Product-Features relation (as checkboxes). But I would like to display only the Features that belongs to the same Category as a Product. I know how to do this in Laravel, f.ex:
$limitedFeatures = array();
foreach($product->features as $feature) {
if ($feature->category_id == $product->id)
$limitedFeatures[] = $value;
}
But don't know where to put this logic in the backend of October.
Last updated