gameJam()->associate(GameJam::find($_POST['gameJamId'])); $group->group_name = $groupName = $_POST['groupName']; $group->group_amount = $_POST['groupAmount']; if(!$group->save()){ return; } $password = New Password(); $password->group()->associate($group); $password->password = password_hash($pass ,PASSWORD_DEFAULT); $token = Str::random(100); $password->remember_token = $token; if(!$password->save()){ return; } $_SESSION['groupName'] = $groupName; $_SESSION['token'] = $token; $_SESSION['success'] = "You are now logged in"; header("location: ../../../Frontend/index.html?success=GroupRegister"); exit(); }else{ header("location: ../../../Frontend/index.html?error=CouldNotValidatePassword"); exit(); } }else{ header("location: ../../../Frontend/index.html?error=FailedRegister"); exit(); }