diff --git a/src/Http/Controllers/Admin/ProjectSettingGroupController.php b/src/Http/Controllers/Admin/ProjectSettingGroupController.php index 775d74d..ef52c08 100644 --- a/src/Http/Controllers/Admin/ProjectSettingGroupController.php +++ b/src/Http/Controllers/Admin/ProjectSettingGroupController.php @@ -20,7 +20,7 @@ class ProjectSettingGroupController extends Controller public function index(ProjectSettingGroupFilter $filters) { $paginationLength = pagination_length(ProjectSettingGroup::class); - $projectSettingGroups = ProjectSettingGroup::filter($filters)->paginate($paginationLength); + $projectSettingGroups = ProjectSettingGroup::visible()->filter($filters)->paginate($paginationLength); return ProjectSettingGroupResource::collection($projectSettingGroups); } diff --git a/src/Models/ProjectSettingGroup.php b/src/Models/ProjectSettingGroup.php index b080539..32fc1b5 100644 --- a/src/Models/ProjectSettingGroup.php +++ b/src/Models/ProjectSettingGroup.php @@ -49,6 +49,11 @@ public function projectSettings() ## Query Scope Methods + public function scopeVisible($query, bool $visible = true) + { + return $query->where('is_visible', $visible); + } + ## Other Methods public function remove()