/** * Clear out all screenshots from the screenshot directory * TODO: Should be removed, as soon as the virtual-filesystem is integrated */ protected function clearScreenshotFolder() { $screenshot = app()->make(Screeenly\Core\Screeenshot\Screenshot::class); $path = $screenshot->setStoragePath(); $files = \Storage::files($path); array_filter($files, function ($file) { \Storage::delete($file); }); }
public function index() { $paths = \Storage::files('blog'); $articles = array(); foreach ($paths as $path) { preg_match('/^.*$/m', \Storage::get($path), $matches); $articles[] = array('uri' => substr($path, 5, -3), 'title' => substr($matches[0], 2)); } return view('blog/index', array('articles' => $articles, 'title' => 'sinkcup的博客')); }
public function drop($filename) { // Cut original file name $dot = strpos($filename, '.'); $origin_name = substr($filename, 0, $dot); // Find all images in basepath $allFiles = \Storage::files($this->basepath); $files = array_filter($allFiles, function ($file) use($origin_name) { return preg_match('/^(.*)' . $origin_name . '(.*)$/', $file); }); // Delete original image and thumbnails foreach ($files as $file) { \Storage::delete($file); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $files = \Storage::files(); return view('admin.proyectos.import', compact('files')); }
public function readImages(Request $request) { return \Storage::files(storage_path('app/uploads/')); }