public function update(AttachmentUpdateRequest $request, $id, $imageId)
    {
        $asset = $this->asset->find($id);

        $image = $this->image->update($request, $asset->images(), $imageId);

        if ($image) {
            $message = 'Successfully updated image.';

            return redirect()->route('maintenance.assets.images.show', [$asset->id, $image->id])->withSuccess($message);
        } else {
            $message = 'There was an issue updating this image. Please try again.';

            return redirect()->route('maintenance.assets.images.show', [$id, $imageId])->withErrors($message);
        }
    }
public function update(AttachmentUpdateRequest $request, $id, $imageId)
    {
        $asset = $this->asset->find($id);

        $image = $this->image->update($request, $asset->images(), $imageId);

        if ($image) {
            $message = 'Successfully updated image.';

            return redirect()->route('maintenance.assets.images.show', [$asset->id, $image->id])->withSuccess($message);
        } else {
            $message = 'There was an issue updating this image. Please try again.';

            return redirect()->route('maintenance.assets.images.show', [$id, $imageId])->withErrors($message);
        }
    }
public function update ( AttachmentUpdateRequest $ request , $ id , $ imageId ) { $ asset = $ this -> asset -> find ( $ id ) ; $ image = $ this -> image -> update ( $ request , $ asset -> images ( ) , $ imageId ) ; if ( $ image ) { $ message = 'Successfully updated image.' ; return redirect ( ) -> route ( 'maintenance.assets.images.show' , [ $ asset -> id , $ image -> id ] ) -> withSuccess ( $ message ) ; } else { $ message = 'There was an issue updating this image. Please try again.' ; return redirect ( ) -> route ( 'maintenance.assets.images.show' , [ $ id , $ imageId ] ) -> withErrors ( $ message ) ; } }
Updates the specified asset image upload.

@param AttachmentUpdateRequest $request
@param int|string              $id
@param int|string              $imageId

@return \Illuminate\Http\RedirectResponse
Updates the specified asset image upload .