acabust
acabust
FFilament
Created by acabust on 11/10/2024 in #❓┊help
How to Pass Dynamic Data from Filament Form to Livewire Component for Price Calculation
I'm trying to create a Livewire component that displays the price of a product within a Filament form. The form allows users to manipulate several select fields (to change color, model, etc.), and each change can affect the price. My goal is to display the updated price whenever the form values change. I've been using this documentation page as a reference: https://filamentphp.com/docs/3.x/forms/advanced#inserting-livewire-components-into-a-form Currently, I can pass fixed values to my Livewire component like this: Forms\Components\Livewire::make(CalculPrixSejour::class, [ 'sejour_id' => '33'; ]), However, it seems impossible to use closures directly. This doesn't work: Forms\Components\Livewire::make(CalculPrixSejour::class, [ 'sejour_id' => function (Get $get) { return $get('sejour_id'); }, ]), It seems odd that I can't pass anything other than fixed values. I must be missing something in the documentation.
6 replies
FFilament
Created by acabust on 9/4/2024 in #❓┊help
Bug (visual): RelationManager AssociateAction multiple select field selected options disappear
Couldnt find anything on Google/Github related. Dont really know where to go from here. " Tables\Actions\AssociateAction::make() ->multiple() ->recordSelectSearchColumns(['awb']) ->preloadRecordSelect() ->recordSelect(fn ($select) => $select ->options($orderQuery->get()->pluck('title', 'id')) ->getSearchResultsUsing(fn ($search) => $orderQuery->where('awb', 'like' ,"%$search%")->get()->pluck('title', 'id')) ) ->associateAnother(false) ->successRedirectUrl(fn ($record) => self::getUrl('view', ['record' => $record])) ->action(function ($data) use ($getOwnerRecord, $relationship) { $getOwnerRecord->{$relationship}()->syncWithoutDetaching($data['recordId']); $getOwnerRecord->touch(); }) , " Using v3.2
3 replies
FFilament
Created by acabust on 4/21/2024 in #❓┊help
Select with relationship and default value
No description
3 replies