diff --git a/app/Filament/Resources/Torrent/TorrentResource.php b/app/Filament/Resources/Torrent/TorrentResource.php index 7c299e8d..3ac6ff86 100644 --- a/app/Filament/Resources/Torrent/TorrentResource.php +++ b/app/Filament/Resources/Torrent/TorrentResource.php @@ -2,6 +2,7 @@ namespace App\Filament\Resources\Torrent; +use App\Filament\OptionsTrait; use App\Filament\Resources\Torrent\TorrentResource\Pages; use App\Filament\Resources\Torrent\TorrentResource\RelationManagers; use App\Models\Setting; @@ -25,6 +26,8 @@ use Illuminate\Support\Str; class TorrentResource extends Resource { + use OptionsTrait; + protected static ?string $model = Torrent::class; protected static ?string $navigationIcon = 'heroicon-o-collection'; @@ -87,9 +90,9 @@ class TorrentResource extends Resource ]) ->defaultSort('id', 'desc') ->filters([ - Tables\Filters\SelectFilter::make('approval_status') - ->options(Torrent::listApprovalStatus(true)) - ->label(__('label.torrent.approval_status')), + Tables\Filters\SelectFilter::make('visible') + ->options(self::$yesOrNo) + ->label(__('label.torrent.visible')), Tables\Filters\SelectFilter::make('pos_state') ->options(Torrent::listPosStates(true)) @@ -98,6 +101,11 @@ class TorrentResource extends Resource Tables\Filters\SelectFilter::make('sp_state') ->options(Torrent::listPromotionTypes(true)) ->label(__('label.torrent.sp_state')), + + Tables\Filters\SelectFilter::make('approval_status') + ->options(Torrent::listApprovalStatus(true)) + ->visible($showApproval) + ->label(__('label.torrent.approval_status')), ]) ->actions([ // Tables\Actions\EditAction::make(), diff --git a/resources/lang/en/label.php b/resources/lang/en/label.php index 7a7d35a4..a602e26f 100644 --- a/resources/lang/en/label.php +++ b/resources/lang/en/label.php @@ -119,6 +119,7 @@ return [ 'approval_status' => 'Approval status', 'pos_state' => 'Pos state', 'sp_state' => 'Promotion', + 'visible' => 'Visible', ], 'hit_and_run' => [ diff --git a/resources/lang/zh_CN/label.php b/resources/lang/zh_CN/label.php index 3a82de67..c6306785 100644 --- a/resources/lang/zh_CN/label.php +++ b/resources/lang/zh_CN/label.php @@ -118,6 +118,7 @@ return [ 'approval_status' => '审核状态', 'pos_state' => '置顶', 'sp_state' => '优惠', + 'visible' => '活种', ], 'hit_and_run' => [ diff --git a/resources/lang/zh_TW/label.php b/resources/lang/zh_TW/label.php index a253f7fa..19d065d3 100644 --- a/resources/lang/zh_TW/label.php +++ b/resources/lang/zh_TW/label.php @@ -119,6 +119,7 @@ return [ 'approval_status' => '審核狀態', 'pos_state' => '置頂', 'sp_state' => '優惠', + 'visible' => '活種', ], 'hit_and_run' => [