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());
    }
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());
    }
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 ( ) ) ; }
Update the specified FAQ in storage.

@param int        $id
@param FAQRequest $request

@return Response
Update the specified FAQ in storage .