schema([ // Section::make("")->schema([ Translate::make()->schema(fn (string $locale) => [ TextInput::make('name')->required($locale == 'zh_TW')->maxLength(40)->label("分類名稱") ]) ->locales(["zh_TW", "en"]) ->columnSpan(5), TextInput::make('order')->label("排序")->integer()->default(0)->columnSpan(1) ])->columns(4) ]); } public static function table(Table $table): Table { return $table ->columns([ // TextColumn::make('name')->label("分類名稱"), TextColumn::make(name: 'created_at')->label("建立時間")->date(), TextColumn::make('updated_at')->label("更新時間")->date() ]) ->filters([ // ]) ->actions([ // Tables\Actions\ViewAction::make(), Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make() ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]) ->defaultSort('order', 'desc') ->defaultSort('created_at', 'desc'); } 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'), ]; } }