diff --git a/app/Http/Controllers/TakeController.php b/app/Http/Controllers/TakeController.php index 05ffec0..1b62c7c 100644 --- a/app/Http/Controllers/TakeController.php +++ b/app/Http/Controllers/TakeController.php @@ -12,6 +12,9 @@ class TakeController extends Controller public function store(Request $request) { $item = User::find(\Auth::id())->items()->find(request('item')); + if ($item->used_by) { + return back()->withErrors("This item is already taken"); + } $item->used_by = \Auth::id(); $item->save(); return redirect('home');