Sorry for not adding the whole schema - there were a lot of fields. Here's what I have:
public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make('Physical Details')
->icon(Heroicon::BookOpen)
->columnSpanFull()
->columns(4)
->collapsible()
->schema([
[... other fields not relevant to this ...]
TextInput::make('page_count')
->columnSpan(2)
->live(onBlur: true)
->numeric(),
[... other fields not relevant to this ...]
TextInput::make('suggested_price_2')
->label('Suggested price (2)')
->disabled()
->state(function (Get $get) {
return filled($get('page_count')) ? '$' . $get('page_count') * .002 : null;
})
]),
I added the filled(...) function per your suggestion but unfortunately I still get the same error.
Again, using
Placeholder::make('suggested_price_1')
->label('Suggested Price (1)')
->content(function (Get $get) {
return '$' . $get('page_count') * .002;
}),
doesn't throw an error so it seemed to me that $get('page_count') wasn't the cause of the problem. If the field has not been filled in yet, the Placeholder method just returns "$ 0"