Using getStateUsing on an infolist component causes PHP to crash
When I add
getStateUsing
to a TextEntry
, PHP exits.
Causes the following in the terminal from docker
That's a SIGSEGV
failure. I'm using Laravel sail with no customisationSolution:Jump to solution
yes, you need to use
->state()
```php
TextEntry::make('name')
->state(fn (App $record): string => $record...)...9 Replies
use
formatStateUsing()
That stops the error but does nothing
There is no state, the
name
field doesn't exist on the modelwhat are you trying to do?
Provide the entries value
inject
$record
?For a form it's:
For a table it's:
I've added a
dd()
to the formatStateUsing
call and it's never reached, I assume because the state is null
And if I use getStateUsing
PHP exits for some odd reasonSolution
yes, you need to use
->state()
Ah that has worked, thank you
Sorry this is my first time using Filament and I keep tripping up on the inconsistencies
welcome
no problem