shareit/app/Http/Controllers/AlertController.php
2018-09-15 02:09:07 -03:00

29 lines
658 B
PHP

<?php
namespace App\Http\Controllers;
use \App\User;
use Illuminate\Http\Request;
class AlertController extends Controller
{
public function store(Request $request)
{
$item = User::find(\Auth::id())->items()->find(request('item'));
$item->waiting_user_id = \Auth::id();
$item->timestamps = false;
$item->save();
return redirect('home');
}
public function delete(Request $request)
{
$item = User::find(\Auth::id())->items()->find(request('item'));
$item->waiting_user_id = null;
$item->timestamps = false;
$item->save();
return redirect('home');
}
}