diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index d6a1abd..b9f94c3 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -49,7 +49,7 @@ class ItemController extends Controller public function patch(Request $request) { $request->validate(['item' => 'required', 'name' => 'required']); - $item = User::find(\Auth::id())->items()->find(request('item')); + $item = User::findOrFail(\Auth::id())->items()->find(request('item')); $item->name = request('name'); $item->save(); return redirect('item/'.request('item'));