file - 如何在 laravel 中使用 Storage::facade 检查目录是否存在?

标签 file laravel storage

对应的是什么:

if (!File::exists($path))

在 Laravel 5.1 中使用 Storage::

有人吗?

最佳答案

试试这个:

// To check if File exists in Laravel 5.1
$exists = Storage::disk('local')->has('file.jpg');

// To check if File exists in Laravel 5.2
$exists = Storage::disk('local')->exists('file.jpg');

关于file - 如何在 laravel 中使用 Storage::facade 检查目录是否存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37134638/

相关文章:

java - 如何访问仅包含部分文件名的文件?

java - JAR 在其自己的安装目录中没有写入权限 (Windows 8)

python - 将一个文件的部分写入另外两个文件

laravel - Laravel 签名路由的安全性如何?

.net - 用于 Blob 写入访问的 SAS 不断导致 Azure 存储出现 403 身份验证错误

javascript - Chrome 扩展程序 : storage listener for only one stored variable

php - 存储60亿个 float ,方便文件访问

c++ - 使用stof引发异常-C++

css - Markdown 邮件按钮 Laravel 无法正常工作

performance - Laravel 真的这么慢吗?