mutate relation data before saving

Hey there,
How can i mutate relation data before editing or creating parent record?
for example i have this code for form:

TextInput::make('first_name')->label('نام')
         ->required(),
TextInput::make('last_name')->label('نام خانوادگی')
         ->required(),
TextInput::make('email')->label('ایمیل')
         ->email()
         ->unique(ignoreRecord: true)
         ->required(),
Repeater::make('contactChannels')
                        ->label('اطلاعات تماس')
                        ->relationship()
                        ->cloneable()
                        ->schema([
                            Select::make('slug')->label('نوع')
                                ->options(ContactChannelTypeEnum::labels())
                                ->native(false)
                                ->selectablePlaceholder(false)
                                ->live()
                                ->afterStateUpdated(function (Set $set, $state) {

                                }),
                            TextInput::make('value')
                                ->extraAttributes([
                                    'class' => '',
                                    'dir' => 'ltr'
                                ])
                                ->extraInputAttributes([
                                    'class' => 'text-left'
                                ])
                                ->prefix(function (Get $get) {
                                    $slug = $get('slug') ?? 'mobile';
                                    return ContactChannelTypeEnum::tryFrom($slug)->prefix();
                                })
                                ->label('مقدار'),


i have access to user data using mutateFormDataBeforeSave() in EditUser.php but it does not contain relation data.
Was this page helpful?