Sanjana
How to get relationship value using Get $get unititlity?
Repeater::make('preferred_working_hours')
->label(('neww-app::neww-app.user.input.preferred_working_hours'))
->schema(function ($get) {
$preferredDays = PreferredDay::getPreferredDay();
$daySchemas = [];
foreach ($preferredDays as $day => $translationKey) {
$daySchemas[] = Checkbox::make($day)->inline()->reactive();
$daySchemas[] = Group::make([
Forms\Components\TimePicker::make("starttime$day")
->label(("neww-app::neww-app.user.input.preferred_working_hours.$day.starttime$day"))
->hidden(function ($get) use ($day) {
return !$get($day);
}),
Forms\Components\TimePicker::make("endtime$day")
->label(__("neww-app::neww-app.user.input.preferred_working_hours.$day.endtime$day"))
->hidden(function ($get) use ($day) {
return !$get($day);
}),
])->columns(2);
}
return $daySchemas;
})
->addable(function ($get) {
return empty($get('preferred_working_hours'));
})
->deletable(false)
->columns(2)
->reorderable(false)
->columnSpanFull() i have to show the item on UI when there is null in this column and wnen i am going to edit the form it give the button to add instaed i want to display the item without add
5 replies