mathieutu
mathieutu
FFilament
Created by mathieutu on 1/21/2025 in #❓┊help
Simple repeater and $get
Hi, When using $get on a simple repeater, the state shown is not the simple array of value shown in the doc, but the internal representation of the repeater.
Repeater::make('invitations')
->simple(
TextInput::make('email')
->email()
->required(),
)
Placeholder::make('foo')->content(fn (Get $get) => dump($get('invitations'))
Repeater::make('invitations')
->simple(
TextInput::make('email')
->email()
->required(),
)
Placeholder::make('foo')->content(fn (Get $get) => dump($get('invitations'))
returns
"invitations" => array:2 [
"cc35096d-4cfc-4207-bbc5-05b70db95fee" => array:1 [
"email" => array:1 [
"email" => null
]
]
"e44bad27-018c-4ef2-af1e-2edd2947687b" => array:1 [
"email" => null
]
]
"invitations" => array:2 [
"cc35096d-4cfc-4207-bbc5-05b70db95fee" => array:1 [
"email" => array:1 [
"email" => null
]
]
"e44bad27-018c-4ef2-af1e-2edd2947687b" => array:1 [
"email" => null
]
]
Is this a known behavior? An issue? Thanks.
2 replies
FFilament
Created by mathieutu on 1/16/2025 in #❓┊help
Macroable class not compatible with ide-helper package.
Hey folks, just FYI we tried to make ide-help compatible with Filament macro, but we're arriving to a dead-end because of the differences between your implementation and the standard one. see https://github.com/barryvdh/laravel-ide-helper/pull/1629#issuecomment-2596171219
1 replies
FFilament
Created by mathieutu on 12/5/2024 in #❓┊help
Replicate with relationship repeater updates original relation records but doesn't create new ones
Pretty much everything in the title. Replicating an invoice, showing the resource form in the replicate modal. When updating the repeating items, the form will update the original items instead of creating new ones. We also can't create the new items in the after method, as the items are not present in the provided $data. Any idea how to achieve that, or should we open an issue?
8 replies
FFilament
Created by mathieutu on 12/4/2024 in #❓┊help
Tenant menu doesn't refresh when the tenant is updated.
Hi, When the tenant is updated, the tenant menu is not, showing the old info. Is there a way to do that, or should I open an issue? Thanks.
2 replies
FFilament
Created by mathieutu on 11/22/2024 in #❓┊help
Computed state in form fields.
Hi, I'd like to have the state totally computed in some form fields. The state would be calculated with a function, and refreshed at each render. Like a Placeholder, but with real fields. Basically doing the same as we can with disabled, or readOnly but with the state. On the table, we can use getStateUsing: Tables\Columns\TextColumn::make('foo')->getStateUsing(fn ($record) => Foo::compute($record)) Setting the state directly using state(fn() => ...) on a TextInput throws an error: Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization (in the getLivewire function). Is it something easily possible? Could we add a getStateUsing to the input as well? (I can open a PR) Thanks!
4 replies