简体   繁体   English

在 laravel 7 中将 base_path() 更改为公共 html

[英]change base_path() to public html in laravel 7

I want to upload file in my website ,but when i upload the file isn't enter to folder public html ,我想在我的网站上上传文件,但是当我上传文件时没有进入文件夹 public html ,

$resorce->move(\base_path() ."public/homepage", $name);

how to change this ?如何改变这一点?

in shared hosting, i am using laravel 7在共享主机中,我使用的是 laravel 7

Try using the helper method public_path() defined here instead of base_path().尝试使用此处定义的辅助方法 public_path() 而不是 base_path()。

Also not sure if this is a direct copy/paste so I just wanted to point out that there is a typo so I've updated the call below.也不确定这是否是直接复制/粘贴,所以我只是想指出有一个错字,所以我更新了下面的电话。

$resource->move(public_path().'homepage');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM