public static function getGroupPermission() { $groupPermission = GroupPermissions::with('aclPermission', 'group')->get(); $permission = array(); foreach ($groupPermission as $row) { $permission[$row->group->id][] = $row->acl_permission->id; } return $permission; }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { if (ACL::checkUserPermission('groups.show') == false) { return Redirect::action('dashboard'); } $title = Lang::get('Group Info'); $groupInfo = Group::find($id); $groupAccess = GroupPermissions::with('aclPermission')->where('group_id', $id)->get(); if (!empty($groupInfo)) { return View::make('groups/show', array('groupInfo' => $groupInfo, 'groupAccess' => $groupAccess, 'title' => $title)); } else { $message = 'Cannot find GroupInfo'; return Redirect::action('settings.groups')->with('error', $message); } }