Пример #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
 /**
  * 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');
     }
 }