JayAyAre
JayAyAre
FFilament
Created by JayAyAre on 2/22/2024 in #❓┊help
Overflow on toggle model
i was trying and i get it with ->columnToggleFormMaxHeight('300px') but anyways thx for help me :DD
4 replies
FFilament
Created by JayAyAre on 2/7/2024 in #❓┊help
Remove options selected on a repeater form
dont use disableOptionsWhenSelectedInSiblingRepeaterItems because this put the selected option on gray, i wanted that the element dissapear directly
3 replies
FFilament
Created by JayAyAre on 2/2/2024 in #❓┊help
Filling a form on editPage
it worked, thanks you so much :DDD
22 replies
FFilament
Created by JayAyAre on 2/2/2024 in #❓┊help
Filling a form on editPage
Forms\Components\TextInput::make('discount') ->live() ->numeric() ->minValue(0) ->minValue(0) ->maxValue(100) ->default(0), Forms\Components\Hidden::make('total_price') ->default(0), Forms\Components\Checkbox::make('budget_client_id') ->label('Client') ->live() ->default(false), Forms\Components\Section::make('section') ->label('Client Information') ->schema([ Forms\Components\TextInput::make('name'), Forms\Components\TextInput::make('last_name'), Forms\Components\TextInput::make('email') ->required(fn(Forms\Get $get) => $get('budget_client_id')), Forms\Components\TextInput::make('telephone'), Forms\Components\TextInput::make('comments') ])->visible(fn(Forms\Get $get) => $get('budget_client_id')) ]); } and my edit code is: public function form(Form $form): Form { return $form; }
22 replies
FFilament
Created by JayAyAre on 2/2/2024 in #❓┊help
Filling a form on editPage
public static function form(Form $form): Form { $modules = Module::all(); return $form ->schema([ Forms\Components\Select::make('modules') ->live() ->default('') ->required() ->multiple() ->options(fn() => $modules->pluck('name')) ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) use ($modules) { $selectedModule = $modules->where('name', $state)->first(); if ($selectedModule) { $discountedPrice = $selectedModule->price * (1 - $get('discount') / 100); $set('total_price', $discountedPrice); } else { $set('total_price', 0); } }),
22 replies