Barış
Barış
FFilament
Created by Barış on 7/18/2024 in #❓┊help
Weird sidebar behaviour
No, the debug bar is not installed. The source of the problem is this package: (https://filamentphp.com/plugins/solution-forest-translate-field). So, it’s not an issue with Filament. Sorry for taking up your time.
8 replies
FFilament
Created by Barış on 7/18/2024 in #❓┊help
Weird sidebar behaviour
No description
8 replies
FFilament
Created by Barış on 7/18/2024 in #❓┊help
Weird sidebar behaviour
No description
8 replies
FFilament
Created by Barış on 11/6/2023 in #❓┊help
Row Action Issue: Incorrect Record Selection
Yes. I've tried everything imaginable.
5 replies
FFilament
Created by Barış on 11/6/2023 in #❓┊help
Row Action Issue: Incorrect Record Selection
Hello again, I solved my problem and I want to share it in case others experience the same issue. It seems like the problem originates from the getTabs method.
public function getTabs(): array
{
return [
'pending' => Tab::make('Bekleyen Talepler')
->icon('heroicon-o-clock')
->modifyQueryUsing(fn(Builder $query) => $query->where('status', 'pending')->orWhere('status', 'in_progress')),
'in_progress' => Tab::make('Üzerimdeki Talepler')
->icon('heroicon-o-phone-arrow-up-right')
->modifyQueryUsing(fn(Builder $query) => $query->where('status', 'in_progress')->where('user_id', auth()->id())),
'completed' => Tab::make('Tamamlananlar')
->icon('heroicon-o-check')
->modifyQueryUsing(fn(Builder $query) => $query->where('status', 'completed')),
];
}
public function getTabs(): array
{
return [
'pending' => Tab::make('Bekleyen Talepler')
->icon('heroicon-o-clock')
->modifyQueryUsing(fn(Builder $query) => $query->where('status', 'pending')->orWhere('status', 'in_progress')),
'in_progress' => Tab::make('Üzerimdeki Talepler')
->icon('heroicon-o-phone-arrow-up-right')
->modifyQueryUsing(fn(Builder $query) => $query->where('status', 'in_progress')->where('user_id', auth()->id())),
'completed' => Tab::make('Tamamlananlar')
->icon('heroicon-o-check')
->modifyQueryUsing(fn(Builder $query) => $query->where('status', 'completed')),
];
}
When I changed it to:
public function getTabs(): array
{
$userId = auth()->id();

return [
'pending' => $this->createTab('Bekleyen Talepler', 'heroicon-o-clock', fn(Builder $query) => $query->whereIn('status', ['pending', 'in_progress'])),
'in_progress' => $this->createTab('Üzerimdeki Talepler', 'heroicon-o-phone-arrow-up-right', fn(Builder $query) => $query->where('status', 'in_progress')->where('user_id', $userId)),
'completed' => $this->createTab('Tamamlananlar', 'heroicon-o-check', fn(Builder $query) => $query->where('status', 'completed')),
];
}

private function createTab(string $name, string $icon, callable $queryModifier): Tab
{
return Tab::make($name)
->icon($icon)
->modifyQueryUsing($queryModifier);
}
public function getTabs(): array
{
$userId = auth()->id();

return [
'pending' => $this->createTab('Bekleyen Talepler', 'heroicon-o-clock', fn(Builder $query) => $query->whereIn('status', ['pending', 'in_progress'])),
'in_progress' => $this->createTab('Üzerimdeki Talepler', 'heroicon-o-phone-arrow-up-right', fn(Builder $query) => $query->where('status', 'in_progress')->where('user_id', $userId)),
'completed' => $this->createTab('Tamamlananlar', 'heroicon-o-check', fn(Builder $query) => $query->where('status', 'completed')),
];
}

private function createTab(string $name, string $icon, callable $queryModifier): Tab
{
return Tab::make($name)
->icon($icon)
->modifyQueryUsing($queryModifier);
}
my problem was solved. It’s very interesting, but it seems to have solved my problem.
5 replies