mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 12:17:10 +00:00
Bruno Fontes
882609fed0
Now it shows the username of who is using an item. Item db field 'usedBy' was renamed to 'used_by' to keep consistence.
19 lines
348 B
PHP
19 lines
348 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use \App\User;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ReturnController extends Controller
|
|
{
|
|
public function store(Request $request)
|
|
{
|
|
$item = User::find(\Auth::id())->items()->find(request('item'));
|
|
$item->used_by = null;
|
|
$item->save();
|
|
|
|
return redirect('home');
|
|
}
|
|
}
|