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

25 lines
505 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['group_name'];
$group->group_amount = $_POST['group_amount'];
$group->game_jam_id = $_POST['game_jam_id'];
$group->save();
}
}
}