You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to confirm() and/or multiselect() it would be nice to have toggle()/toggles() prompt, that would list options and and let you turn them off/on. The result would be an array of all options as keys and true/false as their values.
It's possible to do this using multiselect(), but you have to map the response yourself and visual toggle could be different.
Imagine a NotificationSettings model that stores bool flags in different columns.
While it is possible, it's not as clean as proposed solution. Also, I imagine it would be more performant if it would interact with array keys directly rather than having to use transform and perform in_array() search like in this example.
I still don't like how $default is built in both options, perhaps there's a better solution for that?
Laravel Prompts Version
n/a
Laravel Version
n/a
PHP Version
n/a
Operating System & Version
n/a
Terminal Application
n/a
Description
Similar to
confirm()
and/ormultiselect()
it would be nice to havetoggle()
/toggles()
prompt, that would list options and and let you turn them off/on. The result would be an array of all options as keys andtrue/false
as their values.It's possible to do this using
multiselect()
, but you have to map the response yourself and visual toggle could be different.Imagine a
NotificationSettings
model that stores bool flags in different columns.Pseudo code:
Steps To Reproduce
Nothing, just a feature suggestion.
The text was updated successfully, but these errors were encountered: