src/controllers/GroupController.php
public function postCreate()
    {
        $groupname = Input::get('groupname');
        $permissions = array();

        $errors = $this->_validateGroup(Input::get('permission'), $groupname, $permissions);
        if(!empty($errors)) {
            return Response::json(array('groupCreated' => false, 'errorMessages' => $errors));
        } else {
            try {
                // create group
                Sentry::getGroupProvider()->create(array(
                    'name' => $groupname,
                    'permissions' => $permissions,
                ));
            } catch (\Cartalyst\Sentry\Groups\NameRequiredException $e) {} catch (\Cartalyst\Sentry\Groups\GroupExistsException $e) {
                return Response::json(array('groupCreated' => false, 'message' => trans('syntara::groups.messages.exists'), 'messageType' => 'danger'));
            }
        }

        return Response::json(array('groupCreated' => true,  'redirectUrl' => URL::route('listGroups')));
    }
public function postCreate()
    {
        $groupname = Input::get('groupname');
        $permissions = array();

        $errors = $this->_validateGroup(Input::get('permission'), $groupname, $permissions);
        if(!empty($errors)) {
            return Response::json(array('groupCreated' => false, 'errorMessages' => $errors));
        } else {
            try {
                // create group
                Sentry::getGroupProvider()->create(array(
                    'name' => $groupname,
                    'permissions' => $permissions,
                ));
            } catch (\Cartalyst\Sentry\Groups\NameRequiredException $e) {} catch (\Cartalyst\Sentry\Groups\GroupExistsException $e) {
                return Response::json(array('groupCreated' => false, 'message' => trans('syntara::groups.messages.exists'), 'messageType' => 'danger'));
            }
        }

        return Response::json(array('groupCreated' => true,  'redirectUrl' => URL::route('listGroups')));
    }
Create group