首页 > 解决方案 > 如何在laravel项目之外设置文件夹目标路径

问题描述

我需要设置$destination外部项目的路径需要将文件夹从项目文件复制到计算机位置我已经尝试过使用复制目录功能

public function approovenew()
{
    $source = "themes/call";
    $destination = "/new-theme";
            
    File::copyDirectory(base_path($source), base_path($destination));
}

标签: phplaravellaravel-6

解决方案


尝试这样做它会帮助你

File::copyDirectory(__DIR__ . '/../whatever'$source, __DIR__ . '/../../$destination');

推荐阅读