plan options
This commit is contained in:
1 parent
8463f50f6b
commit
ecb66a76b5
14 files changed
+277
-303
No files matched your search
@@ -2,15 +2,20 @@
|
||||
|
||||
namespace App\Filament\Resources\Kontos\Schemas;
|
||||
|
||||
use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;
|
||||
use App\Models\Konto;
|
||||
use App\Models\Plan;
|
||||
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Filament\Support\Enums\IconPosition;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use JaOcero\RadioDeck\Forms\Components\RadioDeck;
|
||||
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
||||
|
||||
class KontoForm
|
||||
@@ -20,57 +25,77 @@ class KontoForm
|
||||
return $schema
|
||||
->components([
|
||||
|
||||
// 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([
|
||||
TextInput::make('company')
|
||||
->label('Firma')
|
||||
->required(),
|
||||
TextInput::make('uid_number')
|
||||
->label('UID Nummer')
|
||||
->rules([new VatNumber])
|
||||
->required(),
|
||||
Textarea::make('address')
|
||||
->label('Adresse')
|
||||
->required(),
|
||||
TextInput::make('country')
|
||||
->label('Land')
|
||||
->default('Österreich')
|
||||
->required(),
|
||||
])->columnSpanFull(),
|
||||
Section::make('Kontaktperson')
|
||||
->inlineLabel()
|
||||
->schema([
|
||||
TextInput::make('title')
|
||||
->label('Title')
|
||||
->required(),
|
||||
Select::make('gender')
|
||||
->label('Geschlecht')
|
||||
->options([
|
||||
'Herr' => 'Herr',
|
||||
'Frau' => 'Frau',
|
||||
'Non-binary' => 'Non-binary',
|
||||
])
|
||||
->required(),
|
||||
TextInput::make('name')
|
||||
->label('Name')
|
||||
->required(),
|
||||
TextInput::make('email')
|
||||
->label('E-Mail')
|
||||
->unique(table: Konto::class)
|
||||
->required(),
|
||||
PhoneInput::make('phone')
|
||||
->label('Telefon')
|
||||
->defaultCountry('AT'),
|
||||
Tabs::make('Tabs')
|
||||
->tabs([
|
||||
Tab::make('Zahlungsplan')
|
||||
->schema([
|
||||
RadioDeck::make('plan_id')
|
||||
->label('Wählen sie eine Option')
|
||||
->options(fn () => Plan::pluck('name', 'id')->toArray())
|
||||
->descriptions(Plan::options())
|
||||
->icons(fn () => Plan::pluck('icon', 'id')->toArray())
|
||||
->required()
|
||||
->iconPosition(IconPosition::Before) // Before | After
|
||||
->iconSize(IconSize::TwoExtraLarge)
|
||||
->alignment(Alignment::Center) // Start | Center | End
|
||||
->padding('px-4 py-6') // Padding around the deck
|
||||
->extraCardsAttributes([ // Extra attributes for card elements
|
||||
'class' => 'rounded-xl drop-shadow-xl mt-1',
|
||||
])
|
||||
->extraOptionsAttributes([ // Extra attributes for option elements
|
||||
'class' => 'text-2xl md:text-3xl font-black tracking-tight lg:text-4xl',
|
||||
])
|
||||
// ->extraDescriptionsAttributes([ // Extra attributes for description elements
|
||||
// 'class' => 'text-sm font-light',
|
||||
// ])
|
||||
->colors('primary')
|
||||
->columns(3)
|
||||
->columnSpanFull(),
|
||||
])->columnSpanFull(),
|
||||
Tab::make('Firma')
|
||||
->inlineLabel()
|
||||
->schema([
|
||||
TextInput::make('company')
|
||||
->label('Firma')
|
||||
->required(),
|
||||
TextInput::make('uid_number')
|
||||
->label('UID Nummer')
|
||||
->rules([new VatNumber])
|
||||
->required(),
|
||||
Textarea::make('address')
|
||||
->label('Adresse')
|
||||
->required(),
|
||||
TextInput::make('country')
|
||||
->label('Land')
|
||||
->default('Österreich')
|
||||
->required(),
|
||||
])->columnSpanFull(),
|
||||
Tab::make('Kontaktperson')
|
||||
->inlineLabel()
|
||||
->schema([
|
||||
TextInput::make('title')
|
||||
->label('Title')
|
||||
->required(),
|
||||
Select::make('gender')
|
||||
->label('Geschlecht')
|
||||
->options([
|
||||
'Herr' => 'Herr',
|
||||
'Frau' => 'Frau',
|
||||
'Non-binary' => 'Non-binary',
|
||||
])
|
||||
->required(),
|
||||
TextInput::make('name')
|
||||
->label('Name')
|
||||
->required(),
|
||||
TextInput::make('email')
|
||||
->label('E-Mail')
|
||||
->unique(table: Konto::class)
|
||||
->required()
|
||||
->prefixIcon(Heroicon::Envelope),
|
||||
PhoneInput::make('phone')
|
||||
->label('Telefon')
|
||||
->defaultCountry('AT'),
|
||||
])->columnSpanFull(),
|
||||
])->columnSpanFull(),
|
||||
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user