Skip to content

Commit

Permalink
nullsafe commission preset image
Browse files Browse the repository at this point in the history
  • Loading branch information
cholladay0816 committed Sep 7, 2023
1 parent 2a87c39 commit 9de0236
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Http/Controllers/CommissionPresetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ public function store(Request $request)
'price' => $res['price']
]);
# Optional File Upload
$res = $request->image->store('commission-presets', 'do_public');
$commissionPreset->forceFill(['image_path' => $res])->save();
if($request->image) {
$res = $request->image->store('commission-presets', 'do_public');
$commissionPreset->forceFill(['image_path' => $res])->save();
}

return redirect()->to(route('creator.show', [auth()->user(), 'commissions']))
->with(['success' => 'Your Commission Preset has been created!']);
Expand Down

0 comments on commit 9de0236

Please sign in to comment.