how to show default value TextInput from public property
Public latitude;
Textinput::make(lat)-default($this->latitude);
How to show latitude value in filament form input ?
3 Replies
hope this will work
Textinput::make('lat')->default(fn()=>$this->latitude),
not work, thanks.
->default(fn($record) => $record->latitude)
Note that default only works on create
I misread your question sorry. Pretty sure $this isn’t going to be available in a callback like that.
It should be provided to the form in mount.
$this->form->fill([‘lat’ => $this->latitude])
You will also need to handle the other form field in the fill method too though.
It does feel like you are possibly mixing some conventions here though.