Laravel - file_get_contents()在公共文件夹中创建了不必要的上传文件.

问题描述 投票:0回答:1
$json_data = file_get_contents(base_path('app/database/fixtures/xyz.json'));

以上代码是不必要的复制 xyz.json 公共文件夹中。

如何解决这个问题?

php laravel file-get-contents
1个回答
0
投票

在laravel中试试

$json_data =File::get(storage_path('app/database/fixtures/xyz.json'));
© www.soinside.com 2019 - 2024. All rights reserved.