F
Filament12mo ago
Wael

Manage business hours

Is there any plugin same to vue-business-hours https://nifty-bassi-0eabe2.netlify.app/
9 Replies
Weccop
Weccop12mo ago
You could use a pre populated repeater. For the extra times maybe a nested repeater, but I dont now if this is possble.
Wael
WaelOP12mo ago
I thought about it but can I have same structure like adding hours ?
No description
Wael
WaelOP12mo ago
Yes, I know. I just have a problem with adding nested hours, so I want to check if anyone else worked on something similar.
awcodes
awcodes12mo ago
This would have to be a custom form component. I’ve done similar with #awcodes-table-repeater but not with nested data.
awcodes
awcodes12mo ago
No description
Wael
WaelOP12mo ago
It looks so good can I access the code ?
awcodes
awcodes12mo ago
@Wael
TableRepeater::make('hours')
->hiddenLabel()
->minItems(7)
->maxItems(7)
->addable(false)
->deletable(false)
->reorderable(false)
->headers(['Day', 'Closed', 'Start', 'End'])
->default(static::getDefaultHours())
->schema([
Forms\Components\TextInput::make('name')
->hiddenLabel()
->disabled(),
Forms\Components\Toggle::make('closed')
->hiddenLabel()
->inline(false),
Forms\Components\TimePicker::make('start')
->hiddenLabel()
->required()
->seconds(false),
Forms\Components\TimePicker::make('end')
->hiddenLabel()
->required()
->seconds(false),
])
TableRepeater::make('hours')
->hiddenLabel()
->minItems(7)
->maxItems(7)
->addable(false)
->deletable(false)
->reorderable(false)
->headers(['Day', 'Closed', 'Start', 'End'])
->default(static::getDefaultHours())
->schema([
Forms\Components\TextInput::make('name')
->hiddenLabel()
->disabled(),
Forms\Components\Toggle::make('closed')
->hiddenLabel()
->inline(false),
Forms\Components\TimePicker::make('start')
->hiddenLabel()
->required()
->seconds(false),
Forms\Components\TimePicker::make('end')
->hiddenLabel()
->required()
->seconds(false),
])
Wael
WaelOP12mo ago
@awcodes thank you so much 🙏🏻 @awcodes is it possible for you to give me
getDefaultHours
getDefaultHours
?
Want results from more Discord servers?
Add your server