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:
2018-09-14 12:52:07 -03:00
parent bb4cc93723
commit 882609fed0
11 changed files with 59 additions and 36 deletions

View File

@@ -10,7 +10,7 @@ class ReturnController extends Controller
public function store(Request $request)
{
$item = User::find(\Auth::id())->items()->find(request('item'));
$item->usedBy = null;
$item->used_by = null;
$item->save();
return redirect('home');