Skip to content

Commit 02e9b89

Browse files
shanerbaner82claude
andcommitted
Add is_official toggle to Plugin Filament resource
Adds an Official (First-Party) toggle column in the table, a toggle field in the form, and an Official ternary filter so admins can manually control which plugins Ultra subscribers get for free. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 446474d commit 02e9b89

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/Filament/Resources/PluginResource.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public static function form(Schema $schema): Schema
7777
Forms\Components\Select::make('status')
7878
->options(PluginStatus::class),
7979

80+
Forms\Components\Toggle::make('is_official')
81+
->label('Official (First-Party)')
82+
->helperText('Official plugins are free for Ultra subscribers'),
83+
8084
Forms\Components\Textarea::make('description')
8185
->label('Description'),
8286

@@ -198,7 +202,7 @@ public static function form(Schema $schema): Schema
198202
Forms\Components\DateTimePicker::make('approved_at')
199203

200204
->visible(fn (?Plugin $record) => $record?->approved_at !== null),
201-
])
205+
]),
202206
]);
203207
}
204208

@@ -252,6 +256,10 @@ public static function table(Table $table): Table
252256
->placeholder('-')
253257
->toggleable(isToggledHiddenByDefault: true),
254258

259+
Tables\Columns\ToggleColumn::make('is_official')
260+
->label('Official')
261+
->sortable(),
262+
255263
Tables\Columns\ToggleColumn::make('featured')
256264
->sortable(),
257265

@@ -284,6 +292,8 @@ public static function table(Table $table): Table
284292
->options(PluginStatus::class),
285293
Tables\Filters\SelectFilter::make('type')
286294
->options(PluginType::class),
295+
Tables\Filters\TernaryFilter::make('is_official')
296+
->label('Official'),
287297
Tables\Filters\TernaryFilter::make('featured'),
288298
Tables\Filters\TernaryFilter::make('is_active')
289299
->label('Active'),

0 commit comments

Comments
 (0)