© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
5 replies
acabust

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.
Advanced forms - Form Builder - Filament
Solution
Livewire::make(CheckOutInfoList::class, fn (Get $get) => [
    'field_1' => $get('field_1'),
]),
Livewire::make(CheckOutInfoList::class, fn (Get $get) => [
    'field_1' => $get('field_1'),
]),


namespace App\Livewire;

use Livewire\Attributes\Reactive;
use Livewire\Component;

class CheckOutInfoList extends Component
{
    #[Reactive]
    public ?string $field_1;

    public function render()
    {
        return view('livewire.check-out-info-list');
    }
}
namespace App\Livewire;

use Livewire\Attributes\Reactive;
use Livewire\Component;

class CheckOutInfoList extends Component
{
    #[Reactive]
    public ?string $field_1;

    public function render()
    {
        return view('livewire.check-out-info-list');
    }
}


<div>
    {{ $field_1 }}
</div>
<div>
    {{ $field_1 }}
</div>
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Pass Data From Filament TextInput to Livewire Component
FilamentFFilament / ❓┊help
2y ago
How to pass event from livewire component to Form Field Component
FilamentFFilament / ❓┊help
2y ago
how to pass data from modal to component in filament?
FilamentFFilament / ❓┊help
2y ago
pass data from Livewire to Wizard
FilamentFFilament / ❓┊help
15mo ago