modal doesn't save
I have this modal it shows the content i want but doesn't save the changes:
Section::make('Bibliography') ->relationship('bibliography')
->schema([
Actions::make([
Action::make('modal_edit_with_data')
->mountUsing(function (Forms\ComponentContainer $form, Bibliography $record) {
$data = [];
// Get all data in array
$dataRecord = $record->toArray();
// Save in $data by key = value
foreach ($dataRecord as $key => $value) {
$data[$key] = $value;
}
// Get all translations in array and save in $data by key = value
foreach ($record->getTranslationsArray() as $key => $value) {
$data[$key] = $value;
}
// Filled your data to $form and return
return $form->fill($data);
})
->form([
Tabs::make('lang form')
->tabs([
Tabs\Tab::make('En')
->schema([
Forms\Components\RichEditor::make('en.text')
]),
Tabs\Tab::make('Es')
->schema([
Forms\Components\RichEditor::make('es.text')
]),
Tabs\Tab::make('Pt')
->schema([
Forms\Components\RichEditor::make('pt.text')
]),
]),
]),])->Columns('full'),]),
Section::make('Bibliography') ->relationship('bibliography')
->schema([
Actions::make([
Action::make('modal_edit_with_data')
->mountUsing(function (Forms\ComponentContainer $form, Bibliography $record) {
$data = [];
// Get all data in array
$dataRecord = $record->toArray();
// Save in $data by key = value
foreach ($dataRecord as $key => $value) {
$data[$key] = $value;
}
// Get all translations in array and save in $data by key = value
foreach ($record->getTranslationsArray() as $key => $value) {
$data[$key] = $value;
}
// Filled your data to $form and return
return $form->fill($data);
})
->form([
Tabs::make('lang form')
->tabs([
Tabs\Tab::make('En')
->schema([
Forms\Components\RichEditor::make('en.text')
]),
Tabs\Tab::make('Es')
->schema([
Forms\Components\RichEditor::make('es.text')
]),
Tabs\Tab::make('Pt')
->schema([
Forms\Components\RichEditor::make('pt.text')
]),
]),
]),])->Columns('full'),]),
