How to remove item key from repeater on save to json

Hi, I have a piece of code that is like this, the goal is to pass it into https://github.com/kylekatarnls/business-time

Fieldset::make('Schedule Config')
            ->schema([
                Repeater::make('schedule_config.monday')
                ->schema([
                    TextInput::make('time_range'),
                ]),
                Repeater::make('schedule_config.tuesday')
                ->schema([
                    TextInput::make('time_range'),
                ]),
                // other days...
            ])->columns(1),


However when I save it, it save as something like this in my json column

{"friday": [], "monday": [{"time_range": "09:00-12:00"}, {"time_range": "13:00-18:00"}], "sunday": [], "tuesday": [], "saturday": [], "thursday": [], "wednesday": []}


But what I want is more of something like this

{"friday": [], "monday": ["09:00-12:00", "13:00-18:00"], "sunday": [], "tuesday": [], "saturday": [], "thursday": [], "wednesday": []}


Usage of the Schedule class of the business-time package is like this, hence i want to remove the time_range key

Schedule::create([
    'monday'            => ['09:00-12:00', '13:00-18:00'],
    'tuesday'           => ['09:00-12:00', '13:00-18:00'],
    'wednesday'         => ['09:00-12:00'],
    'thursday'          => ['09:00-12:00', '13:00-18:00'],
    'friday'            => ['09:00-12:00', '13:00-20:00'],
]);
GitHub
Carbon mixin to handle business days and opening hours - GitHub - kylekatarnls/business-time: Carbon mixin to handle business days and opening hours
Was this page helpful?