orderBy('order')->orderBy('id'); }); } public static function form(Form $form): Form { return $form ->schema([ Section::make('')->schema([ Translate::make()->schema(fn (string $locale) => [ TextInput::make('title')->label('標題')->columnSpanFull(), Textarea::make('content')->label('內文')->columnSpanFull(), ]) ->locales(['zh_TW', 'en']) ->actions([ app(DeepLService::class)->createTranslationAction('Main', ['title', 'content']), ]) ->id('Main')->columnSpanFull(), Group::make()->schema([ FileUpload::make('img_url')->label('圖片') ->directory('profile-parts') ->acceptedFileTypes(['image/jpeg', 'image/jpg', 'image/png', 'image/webp'])->required()->imageEditor() ->columnSpanFull(), Translate::make()->schema(fn (string $locale) => [ TextInput::make('img_alt')->label('圖片註釋')->columnSpanFull(), ]) ->locales(['zh_TW', 'en']) ->actions([ app(DeepLService::class)->createTranslationAction('Img', ['img_alt']), ]) ->id('Img') ->columnSpanFull(), ])->columnSpanFull(), ])->columns(3), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('title')->label('標題'), ImageColumn::make('img_url')->alignCenter(), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ])->reorderable('order'); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListProfileParts::route('/'), 'create' => Pages\CreateProfilePart::route('/create'), 'edit' => Pages\EditProfilePart::route('/{record}/edit'), ]; } }