From 464c74b0cf1cc1b2670c87463ee3597d1ad8a0bb Mon Sep 17 00:00:00 2001
From: Gardel Valentin <valentin.gardel2@etu.univ-lorraine.fr>
Date: Fri, 27 Mar 2020 16:07:35 +0100
Subject: [PATCH] ajout created_at

---
 php/src/controleur/CtrlComment.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/php/src/controleur/CtrlComment.php b/php/src/controleur/CtrlComment.php
index a93b476..e4abafc 100644
--- a/php/src/controleur/CtrlComment.php
+++ b/php/src/controleur/CtrlComment.php
@@ -5,7 +5,7 @@ namespace bddApp\controleur;
 use bddApp\model\Comment;
 use bddApp\vues\VueComment;
 use bddApp\model\User;
-use Slim\Slim;
+use Carbon\Carbon;
 
 class CtrlComment
 {
@@ -28,6 +28,7 @@ class CtrlComment
         $comm->email = $json["email"];
         $comm->title = $json["title"];
         $comm->content = $json["content"];
+        $comm->created_at = Carbon::now();
         $comm->save();
     }
 }
\ No newline at end of file
-- 
GitLab