F
Filament6mo ago
Wael

Manage business hours

Is there any plugin same to vue-business-hours https://nifty-bassi-0eabe2.netlify.app/
9 Replies
Weccop
Weccop6mo 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
Wael6mo ago
I thought about it but can I have same structure like adding hours ?
No description
Wael
Wael6mo 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
awcodes6mo ago
This would have to be a custom form component. I’ve done similar with #awcodes-table-repeater but not with nested data.
awcodes
awcodes6mo ago
No description
Wael
Wael6mo ago
It looks so good can I access the code ?
awcodes
awcodes6mo 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
Wael6mo ago
@awcodes thank you so much 🙏🏻 @awcodes is it possible for you to give me
getDefaultHours
getDefaultHours
?