Game-Jaming/Backend/Controllers/Group/UpdateGruop.php

25 lines
501 B
PHP

<?php
require "../../../bootstrap.php";
use Backend\Models\Group;
session_start();
if (isset($_POST['updateGroup'])) {
if($group = Group::find($_POST['groupId'])){
if ($group->password->remember_token === $_SESSION['token']){
$group->group_name = $_POST['groupName'];
$group->group_amount = $_POST['groupAmount'];
$group->game_jam_id = $_POST['gameJamId'];
$group->save();
}
}
}