Hi,
I migrated a project from V2 to V3. I have filters inside a model that doesn’t work anymore.
Individually, they work but when I have more than one, all the other ones are cleared.
The issue :
- I select few values in the “# membre” filter
- Then, I select few values in the “Groupe ID” filter
- Click on “Apply”
- The values that was selected previously in “# membre” filter are gone.
What I found :
For the “# member” scope, selected values are inside value and not scopeValue.
Any recommendations?
# ===================================
# Filter Scope Definitions
# ===================================
scopes:
filter_member_id:
label: larnet.osm::lang.backend.dealer.filter.filter_dealer
modelScope: filterDealer
options: getDealersOptions
modelClass: Larnet\Osm\Models\Dealer
dependsOn:
- filter_groupid
- filter_city
- filter_province
- filter_bannerid
- filter_pool
filter_groupid:
label: larnet.osm::lang.backend.dealer.filter.filter_groupid
modelScope: filterGroupId
options: getGroupIdsOptions
modelClass: Larnet\Osm\Models\Dealer
dependsOn:
- filter_member_id
- filter_city
- filter_province
- filter_bannerid
- filter_pool
And in my model Dealer.php;
public function scopeFilterDealer($query, $scope) {
return $query->whereIn('id', $scope->value);
}
public function scopeFilterGroupId($query, $scope) {
$query->whereIn('group_id', $scope->value);
}
Thank you.