public function destroy($id)
    {
        $image = $this->repository->find($id);

        if (is_file(storage_path($image->location))) {
            Storage::delete($image->location);
        } else {
            Storage::disk(Config::get('cms.storage-location', 'local'))->delete($image->location);
        }

        if (empty($image)) {
            Cms::notification('Image not found', 'warning');

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

        $image->forgetCache();
        $image->delete();

        Cms::notification('Image deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.images.index'));
    }
public function destroy($id)
    {
        $image = $this->repository->find($id);

        if (is_file(storage_path($image->location))) {
            Storage::delete($image->location);
        } else {
            Storage::disk(Config::get('cms.storage-location', 'local'))->delete($image->location);
        }

        if (empty($image)) {
            Cms::notification('Image not found', 'warning');

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

        $image->forgetCache();
        $image->delete();

        Cms::notification('Image deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.images.index'));
    }
public function destroy ( $ id ) { $ image = $ this -> repository -> find ( $ id ) ; if ( is_file ( storage_path ( $ image -> location ) ) ) { Storage :: delete ( $ image -> location ) ; } else { Storage :: disk ( Config :: get ( 'cms.storage-location' , 'local' ) ) -> delete ( $ image -> location ) ; } if ( empty ( $ image ) ) { Cms :: notification ( 'Image not found' , 'warning' ) ; return redirect ( route ( $ this -> routeBase . '.images.index' ) ) ; } $ image -> forgetCache ( ) ; $ image -> delete ( ) ; Cms :: notification ( 'Image deleted successfully.' , 'success' ) ; return redirect ( route ( $ this -> routeBase . '.images.index' ) ) ; }
Remove the specified Images from storage.

@param int $id

@return Response
Remove the specified Images from storage .