public function update($id, BlogRequest $request)
    {
        $blog = $this->repository->find($id);

        if (empty($blog)) {
            Cms::notification('Blog not found', 'warning');

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

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

        if (!$validation['errors']) {
            $blog = $this->repository->update($blog, $request->all());

            Cms::notification('Blog updated successfully.', 'success');

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

        return back();
    }
public function update($id, BlogRequest $request)
    {
        $blog = $this->repository->find($id);

        if (empty($blog)) {
            Cms::notification('Blog not found', 'warning');

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

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

        if (!$validation['errors']) {
            $blog = $this->repository->update($blog, $request->all());

            Cms::notification('Blog updated successfully.', 'success');

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

        return back();
    }
public function update ( $ id , BlogRequest $ request ) { $ blog = $ this -> repository -> find ( $ id ) ; if ( empty ( $ blog ) ) { Cms :: notification ( 'Blog not found' , 'warning' ) ; return redirect ( route ( $ this -> routeBase . '.blog.index' ) ) ; } $ validation = app ( ValidationService :: class ) -> check ( Blog :: $ rules ) ; if ( ! $ validation [ 'errors' ] ) { $ blog = $ this -> repository -> update ( $ blog , $ request -> all ( ) ) ; Cms :: notification ( 'Blog updated successfully.' , 'success' ) ; if ( ! $ blog ) { Cms :: notification ( 'Blog could not be saved.' , 'warning' ) ; } } else { return $ validation [ 'redirect' ] ; } return back ( ) ; }
Update the specified Blog in storage.

@param int         $id
@param BlogRequest $request

@return Response
Update the specified Blog in storage .