has($dir); } public static function checkFile($file) { return Storage2::exists($file); } public static function createDir($dir) { Storage2::makeDirectory($dir); return true; } public static function deleteDir($dir) { Storage2::deleteDirectory($dir); return true; } public static function deleteFile($file) { Storage2::delete($file); return true; } public static function secureDeleteFile($file) { $process = new Process(['srm', $file]); $process->run(); if (! $process->isSuccessful()) { throw new ProcessFailedException($process); } } public static function createFile($file, $content) { Storage2::put($file, $content); } public static function getFile($file) { return Storage2::get($file); } public static function getFilesize($file) { return Storage2::size($file); } public static function getUrlFile($file) { return Storage2::url($file); } public static function download($file, $name = false, $headers = false) { return Storage2::download($file, $name, $headers); } public static function getPublicPath($file = false) { return public_path($file); } public static function getFileType($file) { $file = self::getStoragePath().$file; return File::getFileType($file); } public static function getStoragePath($file = false) { return storage_path($file); } }