Skip to content

Commit 39d2aed

Browse files
authored
(re)enable scopes on index view
1 parent 1ae741b commit 39d2aed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/BlueAdminController.php

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function api_index($modelname)
4747

4848
$preloadRelations = array_merge($mapperBelongsTo->pluck('value')->toArray(), $mapperBelongsToMany->pluck('value')->toArray());
4949
$model = $this->config->model::with($preloadRelations)->select($modelname.'.*');
50+
51+
foreach($this->config->index_scopes as $scope) {
52+
$model = $model->{$scope}();
53+
}
5054

5155
$datatablesObject = DataTables::eloquent($model);
5256

0 commit comments

Comments
 (0)