label(__('settings.create')), ]; } public function mount(): void { parent::mount(); // Query string'den activeGroup' 별 al, yoksa tüm ayarları göster (null) $this->activeGroup = request()->query('group', null); } public function getGroups(): \Illuminate\Support\Collection { return \App\Models\Setting::whereNull('deleted_at') ->select('group') ->distinct() ->orderBy('group') ->pluck('group') ->mapWithKeys(function ($group) { return [$group => __("settings.group_{$group}")]; }); } public function setActiveGroup(?string $group): void { $this->activeGroup = $group; } protected function getTableQuery(): \Illuminate\Database\Eloquent\Builder { $query = parent::getTableQuery(); // Eğer bir grup seçildiyse filtrele if ($this->activeGroup) { $query->where('group', $this->activeGroup); } return $query; } protected function getGroupIcon(?string $group): string { if (!$group) { return 'heroicon-o-squares-2x2'; } return match($group) { 'general' => 'heroicon-o-cog-6-tooth', 'theme' => 'heroicon-o-paint-brush', 'localization' => 'heroicon-o-language', 'email' => 'heroicon-o-envelope', 'seo' => 'heroicon-o-magnifying-glass', 'social' => 'heroicon-o-share', 'security' => 'heroicon-o-shield-check', 'upload' => 'heroicon-o-cloud-arrow-up', 'payment' => 'heroicon-o-credit-card', 'notification' => 'heroicon-o-bell', 'cache' => 'heroicon-o-arrow-path', 'api' => 'heroicon-o-code-bracket', 'logging' => 'heroicon-o-document-text', 'performance' => 'heroicon-o-bolt', 'integration' => 'heroicon-o-puzzle-piece', default => 'heroicon-o-squares-2x2', }; } protected function getGroupCount(?string $group): int { if (!$group) { return \App\Models\Setting::whereNull('deleted_at')->count(); } return \App\Models\Setting::where('group', $group) ->whereNull('deleted_at') ->count(); } }