From c8c2687d9ed4ae1755c809927cfb04a0cfbe2629 Mon Sep 17 00:00:00 2001 From: Malibu Date: Fri, 20 Mar 2015 18:59:24 +0100 Subject: [PATCH] jj --- SRC/app/Http/Controllers/GameController.php | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/SRC/app/Http/Controllers/GameController.php b/SRC/app/Http/Controllers/GameController.php index d3722a0..167a99e 100755 --- a/SRC/app/Http/Controllers/GameController.php +++ b/SRC/app/Http/Controllers/GameController.php @@ -72,4 +72,32 @@ class GameController extends Controller { $res = User::referents()->get(); return view('home', ['referent' => $res]); } + + public function setRecords($idTrophee) { + + $values = Cookie::get('trophee'); + + if ($values === false) + $values = [0, 0, 0]; + + switch ($idTrophee) { + + case '1': + $values[0]++; + break; + + case '2': + $values[1]++; + break; + + case '3': + $values[2]++; + break; + + default: + break; + } + $response->withCookie(Cookie::forever('trophee', $values)); + } + }