You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've built a form using a Matrix with 3 columns,
Matrix::make('test')
->title('Matrix Test')
->columns(['User' => 'id', 'Data'=>'date','Hours' => 'hours'])
->fields([
'id' => Select::make()->fromModel(User::class, 'name', 'id')
->required()
->empty('No select'),
'date' => DateTimer::make()
->allowInput()
->required()
->format('Y/m/d'),
'hours' => Input::make()
->allowInput()
->required()
]);
If the form validation fails and the user is redirected back, only the date and hours values are kept, the 'id' column is empty for all the lines in the matrix.
The result is the same using $request->validate or return redirect()->back()->withInput();
Is there a way to keep the values previously selected in the id column ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've built a form using a Matrix with 3 columns,
Matrix::make('test')
->title('Matrix Test')
->columns(['User' => 'id', 'Data'=>'date','Hours' => 'hours'])
->fields([
'id' => Select::make()->fromModel(User::class, 'name', 'id')
->required()
->empty('No select'),
'date' => DateTimer::make()
->allowInput()
->required()
->format('Y/m/d'),
'hours' => Input::make()
->allowInput()
->required()
]);
If the form validation fails and the user is redirected back, only the date and hours values are kept, the 'id' column is empty for all the lines in the matrix.
The result is the same using $request->validate or return redirect()->back()->withInput();
Is there a way to keep the values previously selected in the id column ?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions