src/controllers/GroupController.php
public function getShow($groupId)
    {
        try {
            $group = Sentry::getGroupProvider()->findById($groupId);
            $permissions = PermissionProvider::findAll();

            $groupPermissions = array();
            foreach($group->getPermissions() as $permissionValue => $key) {
                try {
                    $p = PermissionProvider::findByValue($permissionValue);
                    foreach($permissions as $key => $permission) {
                        if($p->getId() === $permission->getId()) {
                            $groupPermissions[] = $permission;
                            unset($permissions[$key]);
                        }
                    }
                } catch(\MrJuliuss\Syntara\Models\Permissions\PermissionNotFoundException $e){}
            }

            // get users in group
            $users = $group->users()->paginate(Config::get('syntara::config.item-perge-page'));

            // users not in group
            $usersNotInGroup = Sentry::getUserProvider()
                ->createModel()
                ->newQuery()
                ->whereNotIn('id', function ($query) use ($groupId) {
                    $query->select('user_id')
                          ->from('users_groups')
                          ->where('group_id', '=', $groupId);
                })
                ->get()
                ->all();

            // ajax request : reload only content container
            if(Request::ajax()) {
                $html = View::make(Config::get('syntara::views.users-in-group'), array('group' => $group, 'users' => $users, 'candidateUsers' => $usersNotInGroup))->render();

                return Response::json(array('html' => $html));
            }

            $this->layout = View::make(Config::get('syntara::views.group-edit'), array('group' => $group, 'users' => $users, 'candidateUsers' => $usersNotInGroup, 'permissions' => $permissions, 'ownPermissions' => $groupPermissions));
            $this->layout->title = 'Group '.$group->getName();
            $this->layout->breadcrumb = array(
                array(
                    'title' => trans('syntara::breadcrumbs.groups'),
                    'link' => URL::route('listGroups'),
                    'icon' => 'glyphicon-list-alt'
                ),
                array(
                    'title' => $group->name,
                    'link' => URL::current(),
                    'icon' => ''
                )
            );
        } catch (\Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
            $this->layout = View::make(Config::get('syntara::views.error'), array('message' => trans('syntara::groups.messages.not-found')));
        }
    }
public function getShow($groupId)
    {
        try {
            $group = Sentry::getGroupProvider()->findById($groupId);
            $permissions = PermissionProvider::findAll();

            $groupPermissions = array();
            foreach($group->getPermissions() as $permissionValue => $key) {
                try {
                    $p = PermissionProvider::findByValue($permissionValue);
                    foreach($permissions as $key => $permission) {
                        if($p->getId() === $permission->getId()) {
                            $groupPermissions[] = $permission;
                            unset($permissions[$key]);
                        }
                    }
                } catch(\MrJuliuss\Syntara\Models\Permissions\PermissionNotFoundException $e){}
            }

            // get users in group
            $users = $group->users()->paginate(Config::get('syntara::config.item-perge-page'));

            // users not in group
            $usersNotInGroup = Sentry::getUserProvider()
                ->createModel()
                ->newQuery()
                ->whereNotIn('id', function ($query) use ($groupId) {
                    $query->select('user_id')
                          ->from('users_groups')
                          ->where('group_id', '=', $groupId);
                })
                ->get()
                ->all();

            // ajax request : reload only content container
            if(Request::ajax()) {
                $html = View::make(Config::get('syntara::views.users-in-group'), array('group' => $group, 'users' => $users, 'candidateUsers' => $usersNotInGroup))->render();

                return Response::json(array('html' => $html));
            }

            $this->layout = View::make(Config::get('syntara::views.group-edit'), array('group' => $group, 'users' => $users, 'candidateUsers' => $usersNotInGroup, 'permissions' => $permissions, 'ownPermissions' => $groupPermissions));
            $this->layout->title = 'Group '.$group->getName();
            $this->layout->breadcrumb = array(
                array(
                    'title' => trans('syntara::breadcrumbs.groups'),
                    'link' => URL::route('listGroups'),
                    'icon' => 'glyphicon-list-alt'
                ),
                array(
                    'title' => $group->name,
                    'link' => URL::current(),
                    'icon' => ''
                )
            );
        } catch (\Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
            $this->layout = View::make(Config::get('syntara::views.error'), array('message' => trans('syntara::groups.messages.not-found')));
        }
    }
Show group
@param type $groupId