예제 #1
0
 public function update(GroupRequest $request, $id)
 {
     $group = \App\Group::findOrFail($id);
     $group->update($request->all());
     $group->swimmers()->sync($request->get('swimmer_list'));
     \Session::flash('flash_message', 'Group has been updated.');
     return redirect('groups');
 }
예제 #2
0
 /**
  * Create a new invite
  *
  * @return Response
  */
 public function store(GroupRequest $request)
 {
     $data = $this->groupService->create($request->all());
     return redirect()->route("group.show", $data->url_name);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param OsjsGroupRequest $request
  * @param  int $id
  * @param OsjsService $service
  * @return \Illuminate\Http\Response
  */
 public function update(GroupRequest $request, $id, OsjsService $service)
 {
     //get the old version
     $group_old = UserGroup::findOrFail($id);
     $old_name = $this->organization->uuid . "-" . $group_old->name;
     //update
     $group = UserGroup::findOrFail($id);
     $group->update($request->all());
     $group->save();
     //get the new version
     $name = $this->organization->uuid . "-" . $group->name;
     if ($path = $service->renameDirectory('group', $old_name, $name)) {
         $group->organization_uuid = $this->organization->uuid;
         $group->realname = $name;
         $group->path = $path;
         $group->save();
         Flash::success(Lang::get('groups.update-success'));
     } else {
         Flash::error(Lang::get('groups.update-failed'));
     }
     return redirect(action('GroupsController@show', ['id' => $id]));
 }
예제 #4
0
 public function storeGroup(GroupRequest $request)
 {
     Group::create($request->all());
     flash()->success('Grupa <b><font color=' . $request->input('color_name') . '>' . $request->input('name') . '</font></b> została dodana!');
     return redirect('/admin');
 }
예제 #5
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(GroupRequest $request, $id)
 {
     $group = Group::find($id);
     if ($group) {
         $input = $request->all();
         $permissions = $request->get('permissions');
         $newpermission = static::format_per($permissions);
         $input['permissions'] = !empty($newpermission) ? json_encode($newpermission) : '';
         $group->fill($input);
         $group->save();
         Session::flash('success', Lang::get('ruban.group.updated'));
         return Redirect::route('ruban.groups.index');
     } else {
         Session::flash('danger', Lang::get('ruban.group.notfound'));
         return Redirect::route('ruban.groups.index');
     }
 }