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

        if (empty($files)) {
            Cms::notification('File not found', 'warning');

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

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

        $files->delete();

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

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

        if (empty($files)) {
            Cms::notification('File not found', 'warning');

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

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

        $files->delete();

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

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

@param int $id

@return Response
Remove the specified Files from storage .