schema([ Select::make('package_id') ->label('Paket') ->options([ 'starter_pack' => 'Starter Pack (5 Events)', 'pro_pack' => 'Pro Pack (20 Events)', 'lifetime_unlimited' => 'Lifetime Unlimited', 'monthly_pro' => 'Pro Subscription', 'monthly_agency' => 'Agency Subscription', ]) ->required(), TextInput::make('credits_added') ->label('Credits hinzugefügt') ->numeric() ->required() ->minValue(0), TextInput::make('price') ->label('Preis') ->numeric() ->step(0.01) ->prefix('€') ->required(), Select::make('platform') ->label('Plattform') ->options([ 'ios' => 'iOS', 'android' => 'Android', 'web' => 'Web', 'manual' => 'Manuell', ]) ->required(), TextInput::make('transaction_id') ->label('Transaktions-ID') ->maxLength(255), Textarea::make('reason') ->label('Beschreibung') ->maxLength(65535) ->columnSpanFull(), ]) ->columns(2); } public function table(Table $table): Table { return $table ->recordTitleAttribute('package_id') ->columns([ TextColumn::make('package_id') ->badge() ->color(fn (string $state): string => match($state) { 'starter_pack' => 'info', 'pro_pack' => 'success', 'lifetime_unlimited' => 'danger', 'monthly_pro' => 'warning', default => 'gray', }), TextColumn::make('credits_added') ->label('Credits') ->badge() ->color('success'), TextColumn::make('price') ->money('EUR'), TextColumn::make('platform') ->badge() ->color(fn (string $state): string => match($state) { 'ios' => 'info', 'android' => 'success', 'web' => 'warning', 'manual' => 'gray', }), TextColumn::make('purchased_at') ->dateTime() ->sortable(), TextColumn::make('transaction_id') ->copyable() ->toggleable(), ]) ->filters([ SelectFilter::make('platform') ->options(['ios' => 'iOS', 'android' => 'Android', 'web' => 'Web', 'manual' => 'Manuell']), SelectFilter::make('package_id') ->options([ 'starter_pack' => 'Starter Pack', 'pro_pack' => 'Pro Pack', 'lifetime_unlimited' => 'Lifetime', 'monthly_pro' => 'Pro Subscription', 'monthly_agency' => 'Agency Subscription', ]), ]) ->headerActions([]) ->actions([ ViewAction::make(), ]) ->bulkActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]); } }