mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 20:26:02 +00:00
19 lines
366 B
PHP
19 lines
366 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use \App\Item;
|
||
|
use \App\User;
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
class TakeController extends Controller
|
||
|
{
|
||
|
public function store(Request $request)
|
||
|
{
|
||
|
$item = User::find(\Auth::id())->items()->find(request('item'));
|
||
|
$item->usedBy = \Auth::id();
|
||
|
$item->save();
|
||
|
return redirect('home');
|
||
|
}
|
||
|
}
|