mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
Joining Take and Return controllers on just Take (store and delete)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user