Update the specified FAQ in storage.

@param int        $id
@param FAQRequest $request

@return Response
491950
public function update($id, FAQRequest $request)
    {
        $faq = $this->repository->find($id);

        if (empty($faq)) {
            Cms::notification('FAQ not found', 'warning');

            return redirect(route($this->routeBase.'.faqs.index'));
        }

        $validation = app(ValidationService::class)->check(FAQ::$rules);

        if (!$validation['errors']) {
            $faq = $this->repository->update($faq, $request->all());
            Cms::notification('FAQ updated successfully.', 'success');

            if (!$faq) {
                Cms::notification('FAQ could not be saved.', 'warning');
            }
        } else {
            return $validation['redirect'];
        }

        return redirect(URL::previous());
    }
331197
public function update(Request $request, $id = null)
    {
        // validate data
        $validator = Validator::make($request->all(), [
            'name'         => 'sometimes|required|string|max:255|unique:roles,name,'.$id,
            'display_name' => 'string|max:255',
            'description'  => 'max:1000'
        ]);

        if ($validator->fails()) {
            return response()->json(arrayView('phpsoft.users::errors/validation', [
                'errors' => $validator->errors()
            ]), 400);
        }

        // check role
        $role = Role::find($id);

        if (!$role) {
            return response()->json(null, 404);
        }

        // update role
        $updateRole = $role->update($request->all());

        if (!$updateRole) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(arrayView('phpsoft.users::role/read', [
            'role' => $role
        ]), 200);
    }
1152351
public function update($id, Request $request)
    {
        $permission = Permission::findOrFail($id);

        $data = $request->all();
        $data['resource'] = $data['controller'] . '@' . $data['method'];

        $validator = Validator::make(
            $data,
            $this->getValidationRules()
        );

        if ($validator->fails()) {
            return back()->withErrors($validator->messages());
        }

        $permission->update($data);

        return redirect()->action('\Aginev\Acl\Http\Controllers\PermissionController@index')
                         ->with('success', trans('acl::permission.edit.updated'));
    }
301226
public function update(Request $request, $id)
    {
        $rules = [
            "address" => "required|max:256",
            "country" => "required",
            "label" => "required|max:50",
            "municipality" => "required|max:128",
            "postcode" => 'required|regex:/^[0-9]{5}(-\d{4})?$/',
            "stateProvince" => "required",
        ];
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate($this->addPolymorphicRules($rules, 'addressable', $request->addressableType));
        $address = Address::findOrFail($id);
        $this->authorize('manage', $address);
        $address->label = $request->label;
        $address->address = $request->address;
        $address->municipality = $request->municipality;
        $address->state_province = $request->stateProvince;
        $address->postcode = $request->postcode;
        $address->country = $request->country;
        $address->save();
        return fractal($address, new AddressTransformer())
            ->withResourceName('address')
            ->respond();
    }
1370484
public function update(Request $request, $id)
    {
        $response = $this->repository->update($id, $request->all());
        return Response::apiResponse([
            'data' => $response
        ]);

    }
858354
public function update(Request $request, $id)
    {
        $this->validate($request, ['name' => 'required']);

        $permission = Permission::findOrFail($id);
        $permission->update($request->all());

        return redirect('admin/permissions')->with('flash_message', 'Permission updated!');
    }
113291
public function update(Update $request, $id)
    {
        try {
            $data = !$request->has('password') ? $request->except('password') : $this->inputAll();

            $user = $this->repository->findById($id);

            $user->update($data);

            $user->roles()->sync((array) \Input::get('role'));

            return $this->redirect('users.index');
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
122510
public function update($id, UpdatePermissionRequest $request)
    {
        $permission = $this->repository->findWithoutFail($id);

        if (empty($permission)) {
            return $this->sendError('Permission not found');
        }

        $permission = $this->repository->update($request->all(), $id);
        $permission->load($request->getWith());

        return $this->sendResponse($permission, 'Permission updated successfully.');
    }
1096434
public function update(Request $request, $id)
    {
        $this->validate($request, ['text' => 'required|max:64|regex:/^[ a-zA-Z0-9_.-]*$/']);

        $tag = Tag()::findOrFail($id);
        $tag->text = $request->text;
        $tag->save();
    }
86639
public function edit(FaqRequest $request, Faq $faq)
    {
        return $this->response->title(trans('app.edit') . ' ' . trans('faq::faq.name'))
            ->view('faq::faq.edit', true)
            ->data(compact('faq'))
            ->output();
    }
74350
public function update(Request $request, $id)
    {
        $fb = Flipbook::find($id);
        $input = $request->all();
        //  return dd($input);

        $fb->content .= ",";
        $i = 1;
        foreach($request->files as $uploadedFile )
            //if($request->hasFile('flip_img'))
        {
            // echo "hi";
            // $request->file()
            // $name = $uploadedFile->getClientOriginalName();

            //$image =  $request->file('flip_img');
            $filename  = time().'_'. $i . '.' . $uploadedFile->getClientOriginalExtension();
            $i++;
            $file = $uploadedFile->move(public_path('rudra/fbook/pics/'), $filename);
            //$path = public_path('rudra/flipbook/pics/' . $filename);
            $path = 'rudra/fbook/pics/' . $filename;

            // Image::make($image->getRealPath())->resize(200, 200)->save($path);
            $fb->content .= $path .",";

        }

        $fb->content = rtrim($fb->content,",");

        $fb->name = $input['book_name'];
        $fb->desc = $input['desc'];
        // $input['urlname'] = strtolower(preg_replace('/[ ,]+/', '-', trim($input['name'])));
        $fb->save();
        //dd($input);
        //exit;
        // Subcategory::create($input);
        return Redirect::route('flipbook.index');
    }
1047564
public function update(RoleRequest $request, $id)
    {
        $role = Role::findOrFail($id);

        $role->update($request->all());
        $role->setPermissions($request->permissions);
    }
665632
public function update($id)
    {
        $parameters = $this->validateRequest(true);
        $model = $this->repository->update($id, $parameters);
        return $this->modelResponse($model);
    }
648521
public function update(UpdateUserRequest $request, $id)
    {
        $user = User::find($id);
        $user->update($request->intersect(['email','name','password']));
        return Response::json(['updated' => true ]);
    }
10910
public function update(SeoPagesRequest $request, $id)
    {
        $input = $request->all();

        $record = $this->model->findOrFail($id);

        $record->update($input);

        $this->notify([
            'type' => 'success',
            'title' => 'Successful update!',
            'description' => 'SeoPage is updated successfully.',
        ]);

        return redirect()->back();
    }
804827
public function update(SubmitRequest $request, $id = null)
    {
        $id = is_null($id) ? $request->input('id') : $id;
        $this->service->update($id, $request->except(['userType']));

        return $this->success();
    }
1187545
public function update(Request $request, $id)
    {
        if ($request->input('action') == 'update_account') {
            try {
                $this->userRepositoryInterface->update($request->all(), $id);
            } catch (FormValidationException $e) {
                Flash::error($e->getMessage());

                return redirect()
                  ->route('account.edit')
                  ->withErrors($e->getErrors())
                  ->withInput();
            } catch (UsersException $e) {
                Flash::error($e->getMessage());

                return redirect()->route('dashboard.index');
            }

            Flash::success(trans('dashboard::dashboard.flash.account.success'));

            return redirect()->route('account.edit');
        }

        if ($request->input('action') == 'change_password') {
            try {
                $this->userRepositoryInterface->updatePassword($request->all());
            } catch (FormValidationException $e) {
                Flash::error($e->getMessage());

                return redirect()
                  ->route('account.edit')
                  ->withErrors($e->getErrors());
            } catch (AuthenticationException $e) {
                Flash::error(trans('dashboard::dashboard.flash.password.fail'));

                return redirect()
                  ->route('account.edit');
            }

            Flash::success(trans('dashboard::dashboard.flash.password.success'));

            return redirect()->route('account.edit');
        }
    }