F
Filamentβ€’2y ago
Husky110

Auto-Enable Toggle

Hey - As the title suggests: I'm trying to auto-enable a toggle-button. I tried treating it like a checkbox via Toggle::make('MyToggle')->default(true) but to no avail. I tried to use 1 or "on" as states, still nothing. Anyone has an idea on how to acchieve this?
9 Replies
Dan Harrin
Dan Harrinβ€’2y ago
are you on the edit or create page
Husky110
Husky110OPβ€’2y ago
Neither. Using a form-page to display information. So it's not bound to anything.
Dan Harrin
Dan Harrinβ€’2y ago
and how are you filling data into the form
Husky110
Husky110OPβ€’2y ago
That is what I wanna do with this in fact. πŸ˜„ It's sort of an overwiew-page whereas the toggles shall show what has been done and what not, which is why I want it to be enabled. πŸ™‚
Dan Harrin
Dan Harrinβ€’2y ago
$this->form->fill([])? pass your data as an array? plesse check the getting started docs
Husky110
Husky110OPβ€’2y ago
Jesus - I keep forgetting that!
Husky110
Husky110OPβ€’2y ago
could you please make the function available in the parent-class, so it shows up in the IDE?
Dan Harrin
Dan Harrinβ€’2y ago
not our responsibility IMO, its a Livewire method also, if i added it to the parent class you wouldnt be able to customize the parameters in the child class so its a breaking change and unnessecarily limiting
Husky110
Husky110OPβ€’2y ago
ah okay - I see. Okay. Thanks again! (Imma go into my little moron-corner... πŸ˜„ )
Want results from more Discord servers?
Add your server