Skip to content

Commit

Permalink
feat(manage): add has_dynamic_rp filter to GameResource (#3124)
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland authored Jan 30, 2025
1 parent 88e9db7 commit 870f69c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/Filament/Resources/GameResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,31 @@ public static function table(Table $table): Table
blank: fn (Builder $query): Builder => $query,
),

Tables\Filters\TernaryFilter::make('has_dynamic_rp')
->label('Has dynamic rich presence')
->placeholder('Any')
->trueLabel('Yes')
->falseLabel('No')
->queries(
true: fn (Builder $query): Builder => $query
->whereNotNull('RichPresencePatch')
->whereNotIn('ConsoleID', System::getNonGameSystems())
->where(function (Builder $query) {
$query->where('RichPresencePatch', 'LIKE', '%@%')
->orWhere('RichPresencePatch', 'LIKE', '%?%');
}),
false: fn (Builder $query): Builder => $query
->whereNotIn('ConsoleID', System::getNonGameSystems())
->where(function (Builder $query) {
$query->whereNull('RichPresencePatch')
->orWhere(function (Builder $query) {
$query->where('RichPresencePatch', 'NOT LIKE', '%@%')
->where('RichPresencePatch', 'NOT LIKE', '%?%');
});
}),
blank: fn (Builder $query): Builder => $query,
),

Tables\Filters\TernaryFilter::make('duplicate_achievement_badges')
->label('Has stock/recycled achievement badges')
->placeholder('Any')
Expand Down

0 comments on commit 870f69c

Please sign in to comment.