© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Anik

repeater values for previous row

Hi, I have a Repeater for time slots where slots must not overlap and each slot's start must be after the end of the previous one. Kindly help me validate the code.
    public function getAvailableSlots($day)
    {
        return TableRepeater::make('data.' . $day)->label(ucfirst($day))->columnSpan('full')->hideLabels()->emptyLabel('No available slots.')->schema([
            Forms\Components\TimePicker::make('start')
                ->label('Start Time')
                ->seconds(false)
                ->lazy(),
            Forms\Components\TimePicker::make('end')
                ->label('End Time')
                ->seconds(false)
                ->lazy()
                ->extraInputAttributes(function (Get $get) {
                    return [
                        'min' => Carbon::parse($get('start'))->addHour()->format('H:i')
                    ];
                }),
            Forms\Components\TextInput::make('rate')
                ->label('Rate'),
        ]);
    }
    public function getAvailableSlots($day)
    {
        return TableRepeater::make('data.' . $day)->label(ucfirst($day))->columnSpan('full')->hideLabels()->emptyLabel('No available slots.')->schema([
            Forms\Components\TimePicker::make('start')
                ->label('Start Time')
                ->seconds(false)
                ->lazy(),
            Forms\Components\TimePicker::make('end')
                ->label('End Time')
                ->seconds(false)
                ->lazy()
                ->extraInputAttributes(function (Get $get) {
                    return [
                        'min' => Carbon::parse($get('start'))->addHour()->format('H:i')
                    ];
                }),
            Forms\Components\TextInput::make('rate')
                ->label('Rate'),
        ]);
    }


I want to get the value of the previous index in the json array for validation
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

filament repeater to store values to multiple rows
FilamentFFilament / ❓┊help
11mo ago
Repeater clone mark cloned row
FilamentFFilament / ❓┊help
2y ago
Add repeater row via return
FilamentFFilament / ❓┊help
3y ago
Refresh repeater values when value outside repeater changes
FilamentFFilament / ❓┊help
2y ago