不,其实是
File::makeDirectory($path);
另外,你可以试试这个:
$path = public_path().'/images/article/imagegallery/' . $galleryId;
File::makeDirectory($path, $mode = 0777, true, true);
更新:实际上它正在工作,mkdir正在后面被使用.这是来源:
/**
* Create a directory.
*
* @param string $path
* @param int $mode
* @param bool $recursive
* @param bool $force
* @return bool
*/
public function makeDirectory($path, $mode = 0777, $recursive = false, $force = false)
{
if ($force)
{
return @mkdir($path, $mode, $recursive);
}
else
{
return mkdir($path, $mode, $recursive);
}
}
删除:
public function deleteDirectory($directory, $preserve = false);
检查源在以下路径(在您的本地安装):
root/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php