我在/ public / images /目录下的文件。它不允许我从目录中取消链接文件。
试试这个:
if(file_exists($data->location)) {
unlink($data->location);
// this path should be public_path() not the url site path
}
Note
: - 取消链接功能允许公共或存储路径不允许网站或网址路径取消链接。
例如:
允许此路径:
C:\ XAMPP \ htdocs中\ laravel \公
不允许这条路径: