Beispiel #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param Requests\UpdateMemberRequest|Request $request
  * @param Member $member
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\UpdateMemberRequest $request, Member $member)
 {
     $input = $request->all();
     if (isset($input['loot']) && $input['loot'] != '0') {
         $member->loot()->attach($input['loot'], ['awarded_at' => $input['awarded_at']]);
         unset($input['loot']);
     }
     $member->update($input);
     return redirect('members');
 }
Beispiel #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Member $memberObj, Request $request)
 {
     $this->validate($request, $this->rules);
     $inputArr = Input::all();
     $socialSiteArr = $inputArr['site'];
     $categoryIdArr = $inputArr['category_id'];
     Member::saveMemberCategoryIds($categoryIdArr, $memberObj->id);
     $inputArr = array_except($inputArr, '_method', 'site', 'category_id');
     $memberObj->update($inputArr);
     Member::saveMemberSocialIds($socialSiteArr, $memberObj->id);
     return Redirect::route('members.edit', [$memberObj->id])->with('message', 'Member updated.');
 }