storage_path('/app/public/') 的确切位置在哪里
Where is storage_path('/app/public/') located exactly
我想通过命令行运行此代码:
public function handle()
{
if ( ! File::exists(storage_path('/app/public/examResult/' . $this->argument('file'))) ) {
dd('Not found this file!');
}
Excel::import(new ImportsExamResultImport(), storage_path('/app/public/examResult/' . $this->argument('file')));
dd('Import excel was successfully');
}
所以它基本上读取位于 storage_path('/app/public/examResult/')
目录的 Excel 文件。
所以我将我的 Excel 文件放在 laravelproject/app/public/examResult
但当我 运行 命令执行它时,我收到此消息:
没有找到这个文件!
所以问题是,storage_path
到底在哪里?我把文件放在正确的地方了吗?
设置新项目时,您需要 运行 :
php artisan storage:link
从laravelproject/public/storage到laravelproject/storage
建立一个符号link
storage_path('/app/public')
可以在 :
找到
laravelproject/storage/app/public
我想通过命令行运行此代码:
public function handle()
{
if ( ! File::exists(storage_path('/app/public/examResult/' . $this->argument('file'))) ) {
dd('Not found this file!');
}
Excel::import(new ImportsExamResultImport(), storage_path('/app/public/examResult/' . $this->argument('file')));
dd('Import excel was successfully');
}
所以它基本上读取位于 storage_path('/app/public/examResult/')
目录的 Excel 文件。
所以我将我的 Excel 文件放在 laravelproject/app/public/examResult
但当我 运行 命令执行它时,我收到此消息:
没有找到这个文件!
所以问题是,storage_path
到底在哪里?我把文件放在正确的地方了吗?
设置新项目时,您需要 运行 :
php artisan storage:link
从laravelproject/public/storage到laravelproject/storage
建立一个符号linkstorage_path('/app/public')
可以在 :
找到laravelproject/storage/app/public