对应的是什么:
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/