schema([ Section::make("")->schema([ Group::make()->schema([ Translate::make()->schema(fn (string $locale) => [ TextInput::make('name')->required($locale == 'zh_TW')->maxLength(40)->label("分類名稱")->columnSpan(1) ]) ->locales(["zh_TW", "en"]) ->actions([ app(DeepLService::class)->createTranslationAction("Main", ["name"]) ])->columnSpan(2), ])->columns(4)->columnSpanFull(), Group::make()->schema([ TextInput::make('order')->label("排序")->integer()->default(0)->columnSpan(1) ])->columnSpanFull()->columns(4), ])->columns(4) ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make("name")->label("分類名稱"), TextColumn::make("visible_str")->label("顯示/不顯示") ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListNewsCategories::route('/'), 'create' => Pages\CreateNewsCategory::route('/create'), 'edit' => Pages\EditNewsCategory::route('/{record}/edit'), ]; } }