diff --git a/app/Filament/Resources/Kontos/Schemas/KontoForm.php b/app/Filament/Resources/Kontos/Schemas/KontoForm.php index df996cf..a43b595 100644 --- a/app/Filament/Resources/Kontos/Schemas/KontoForm.php +++ b/app/Filament/Resources/Kontos/Schemas/KontoForm.php @@ -19,13 +19,16 @@ class KontoForm { return $schema ->components([ - ImageRadioGroup::make('plan_id') - ->animation(true) - ->disk('promotion') - ->label('Plan') - ->required() - ->columnSpanFull() - ->options(fn () => Plan::pluck('promotion', 'id')->toArray()), + + // Radio Cards with default features + + // ImageRadioGroup::make('plan_id') + // ->animation(true) + // ->disk('promotion') + // ->label('Plan') + // ->required() + // ->columnSpanFull() + // ->options(fn () => Plan::pluck('promotion', 'id')->toArray()), Section::make('Firma') ->inlineLabel() ->schema([ diff --git a/app/Filament/Resources/Kontos/Tables/KontosTable.php b/app/Filament/Resources/Kontos/Tables/KontosTable.php index 7c2b607..08e0f1f 100644 --- a/app/Filament/Resources/Kontos/Tables/KontosTable.php +++ b/app/Filament/Resources/Kontos/Tables/KontosTable.php @@ -2,6 +2,7 @@ namespace App\Filament\Resources\Kontos\Tables; +use App\Forms\Components\PlanRadioGroup; use Filament\Actions\Action; use Filament\Actions\EditAction; use Filament\Forms\Components\RichEditor; @@ -42,7 +43,21 @@ class KontosTable ]) ->recordActions([ EditAction::make()->iconButton()->color('gray'), - Action::make('Laden') + Action::make('Konto') + ->iconButton() + ->color('gray') + ->icon('lucide-plane-takeoff') + ->schema([ + PlanRadioGroup::make('plan_id') + ->label('Plan') + ->options(fn () => Plan::pluck('name', 'id')->toArray()), + // ->options([ + // '1' => 'Basic', + // '2' => 'Smart', + // '3' => 'Premium', + // ]), + ]), + Action::make('Bezahlen') ->iconButton() ->color('gray') ->icon('heroicon-o-credit-card') diff --git a/app/Forms/Components/PlanRadioGroup.php b/app/Forms/Components/PlanRadioGroup.php new file mode 100644 index 0000000..957da04 --- /dev/null +++ b/app/Forms/Components/PlanRadioGroup.php @@ -0,0 +1,24 @@ +options = $options; + + return $this; + } + + public function getOptions(): array + { + return $this->evaluate($this->options); + } +} diff --git a/resources/views/forms/components/custom-radio-group.blade.php b/resources/views/forms/components/custom-radio-group.blade.php new file mode 100644 index 0000000..b6fda25 --- /dev/null +++ b/resources/views/forms/components/custom-radio-group.blade.php @@ -0,0 +1,22 @@ +@php + $state = $getState(); // Get the current state of the radio group + $options = $getOptions(); // Assuming you have a method to get options in your component + $name = $getName(); // Get the field name for the input +@endphp + +
+ @foreach ($options as $value => $label) + +
+ @endforeach +