diff --git a/app/Http/Controllers/ReturnController.php b/app/Http/Controllers/ReturnController.php deleted file mode 100644 index d0acd62..0000000 --- a/app/Http/Controllers/ReturnController.php +++ /dev/null @@ -1,18 +0,0 @@ -items()->find(request('item')); - $item->used_by = null; - $item->save(); - - return redirect('home'); - } -} diff --git a/app/Http/Controllers/TakeController.php b/app/Http/Controllers/TakeController.php index ab30be1..85d0b54 100644 --- a/app/Http/Controllers/TakeController.php +++ b/app/Http/Controllers/TakeController.php @@ -15,4 +15,13 @@ class TakeController extends Controller $item->save(); return redirect('home'); } + + public function delete(Request $request) + { + $item = User::find(\Auth::id())->items()->find(request('item')); + $item->used_by = null; + $item->save(); + + return redirect('home'); + } } diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 0347eda..3a26222 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -5,8 +5,7 @@