with('group', $group); } /** * Validates and stores the new User Group data. * * @author [A. Gianotto] [name = e(Input::get('name')); $group->permissions = json_encode(Input::get('permission')); if ($group->save()) { return redirect()->route("groups.index")->with('success', trans('admin/groups/message.success.create')); } return redirect()->back()->withInput()->withErrors($group->getErrors()); } /** * Returns a view that presents a form to edit a User Group. * * @author [A. Gianotto] [decodePermissions(); $selected_array = Helper::selectedPermissionsArray($permissions, $groupPermissions); return View::make('groups/edit', compact('group', 'permissions', 'selected_array', 'groupPermissions')); } /** * Validates and stores the updated User Group data. * * @author [A. Gianotto] [route('groups')->with('error', trans('admin/groups/message.group_not_found', compact('id'))); } $group->name = e(Input::get('name')); $group->permissions = json_encode(Input::get('permission')); if (!config('app.lock_passwords')) { if ($group->save()) { return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.update')); } return redirect()->back()->withInput()->withErrors($group->getErrors()); } return redirect()->route('groups')->with('error', trans('general.feature_disabled')); } /** * Validates and deletes the User Group. * * @author [A. Gianotto] [route('groups')->with('error', trans('admin/groups/message.group_not_found', compact('id'))); } $group->delete(); // Redirect to the group management page return redirect()->route('groups')->with('success', trans('admin/groups/message.success.delete')); } return redirect()->route('groups')->with('error', trans('general.feature_disabled')); } }