shareit/app/Http/Controllers/TakeController.php

19 lines
367 B
PHP
Raw Normal View History

2018-09-13 00:27:35 +00:00
<?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->used_by = \Auth::id();
2018-09-13 00:27:35 +00:00
$item->save();
return redirect('home');
}
}