Skip to content

Commit

Permalink
Inline fields when updating
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Nov 7, 2024
1 parent c5710b8 commit 7862b74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/ReportTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ public function update(Request $request, ReportTemplate $reportTemplate): Redire
// Ignore "options" rules since data does not come in under that key...
$validated = $request->validate(Arr::except((new ReportTemplate)->getRules(), 'options'));

$reportTemplate->name = $validated['name'];
$reportTemplate->options = $request->except(['_token', 'name']);
$reportTemplate->save();
$reportTemplate->update([
'name' => $validated['name'],
'options' => $request->except(['_token', 'name']),
]);

session()->flash('success', trans('admin/reports/message.update.success'));

Expand Down

0 comments on commit 7862b74

Please sign in to comment.