Laravel 中 File::put() 存储在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40325862/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is the File::put() stored in Laravel?
提问by stat.us
I have a question relating to Laravel, where is the File::put()
stored in Laravel?
我有一个关于 Laravel 的问题,Laravel 中的File::put()
存储在哪里?
I have checked inside storage/app/public
and the content isn't there.
我查了里面storage/app/public
的内容没有。
回答by iCoders
File::put
store in public
folder
File::put
存放在public
文件夹中
for example .In this case file.txt will be created in public folder
例如。在这种情况下,file.txt 将在公共文件夹中创建
File::put('file.txt', 'contents is written inside file.txt');
Also you can use Storage class
您也可以使用 Storage 类
Storage::put( 'file.txt','contents is written inside file.txt' );
This will create file inside storage\app
这将在里面创建文件 storage\app
回答by Amit Gupta
回答by José Eduardo Rios
to make sure the location you can use the functions
确保您可以使用功能的位置
- public_path ()
- storage_path ()
- app_path ()
- 公共路径()
- 存储路径()
- app_path()
ex:
前任:
File::put(public_path('uploads'), $data);