From 44c8fc828cdbd4a390a7a1a763b73d54d95f1f9a Mon Sep 17 00:00:00 2001 From: RundelhausCode Date: Mon, 8 Mar 2021 13:09:50 +0100 Subject: [PATCH] model update --- Backend/Controllers/User/Login.php | 2 +- Backend/Controllers/User/SigningUp.php | 4 ++-- Backend/Controllers/keyWordsRemaining.php | 2 +- Backend/Models/GameData.php | 2 +- Backend/Models/GameJam.php | 6 +++--- Backend/Models/Group.php | 2 +- Backend/Models/KeyWord.php | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Backend/Controllers/User/Login.php b/Backend/Controllers/User/Login.php index 451b241..b5feeb5 100644 --- a/Backend/Controllers/User/Login.php +++ b/Backend/Controllers/User/Login.php @@ -13,7 +13,7 @@ if(isset($_POST['login'])){ $groupName = $_POST["groupName"]; $password = $_POST["password"]; - $group = Group::firstWhere('groupName', $groupName ); + $group = Group::firstWhere('group_name', $groupName ); if($group){ $hashedPassword = $group->password->password; if(password_verify($password, $hashedPassword )){ diff --git a/Backend/Controllers/User/SigningUp.php b/Backend/Controllers/User/SigningUp.php index 27d5028..f9c8e9e 100644 --- a/Backend/Controllers/User/SigningUp.php +++ b/Backend/Controllers/User/SigningUp.php @@ -20,9 +20,9 @@ if(isset($_POST['reg_group'])){ $group->gameJam()->associate(GameJam::find($_POST['gameJamId'])); - $group->groupName = $groupName = $_POST['groupName']; + $group->group_name = $groupName = $_POST['groupName']; - $group->groupAmount = $_POST['groupAmount']; + $group->group_amount = $_POST['groupAmount']; if(!$group->save()){ return; diff --git a/Backend/Controllers/keyWordsRemaining.php b/Backend/Controllers/keyWordsRemaining.php index 45d9754..a653e60 100644 --- a/Backend/Controllers/keyWordsRemaining.php +++ b/Backend/Controllers/keyWordsRemaining.php @@ -17,7 +17,7 @@ if (session_status() === PHP_SESSION_ACTIVE) { $keyword = new KeyWord(); //Take the keyWord the user typed and set it equal to the keyword valuable - $keyword->keyWord = $_POST['key_word']; + $keyword->key_word = $_POST['key_word']; //Make foreign key from the groups table to the keyWords table $keyword->group()->associate($group); diff --git a/Backend/Models/GameData.php b/Backend/Models/GameData.php index f43a687..582dd9b 100644 --- a/Backend/Models/GameData.php +++ b/Backend/Models/GameData.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model as Eloquent; class GameData extends Eloquent { protected $fillable = [ - 'gameLink', 'isWebBased', "img" + 'game_link', 'is_web_Based', "img" ]; public function group(){ diff --git a/Backend/Models/GameJam.php b/Backend/Models/GameJam.php index 480f764..a12bc32 100644 --- a/Backend/Models/GameJam.php +++ b/Backend/Models/GameJam.php @@ -6,9 +6,9 @@ class GameJam extends Eloquent{ protected $fillable =[ 'name', - 'startTime', - 'endTime', - 'keyWord', + 'start_time', + 'end_time', + 'key_word', 'description' ]; diff --git a/Backend/Models/Group.php b/Backend/Models/Group.php index a7681c5..fa5a5c6 100644 --- a/Backend/Models/Group.php +++ b/Backend/Models/Group.php @@ -4,7 +4,7 @@ use Illuminate\Database\Eloquent\Model as Eloquent; class Group extends Eloquent { protected $fillable = [ - 'groupName', 'groupAmount', 'votes' + 'group_name', 'group_amount', 'votes' ]; public function gameJam(){ diff --git a/Backend/Models/KeyWord.php b/Backend/Models/KeyWord.php index cd40593..3df3fa5 100644 --- a/Backend/Models/KeyWord.php +++ b/Backend/Models/KeyWord.php @@ -3,7 +3,7 @@ namespace Backend\Models; use Illuminate\Database\Eloquent\Model as Eloquent; class KeyWord extends Eloquent{ protected $fillable =[ - 'keyWord' + 'key_word' ];