mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
Including occupied username and renaming DB field
Now it shows the username of who is using an item. Item db field 'usedBy' was renamed to 'used_by' to keep consistence.
This commit is contained in:
@@ -11,7 +11,7 @@ class TakeController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$item = User::find(\Auth::id())->items()->find(request('item'));
|
||||
$item->usedBy = \Auth::id();
|
||||
$item->used_by = \Auth::id();
|
||||
$item->save();
|
||||
return redirect('home');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user