表格Laravel 5.2文件:
When using the local driver, note that all file operations are relative to the root directory defined in your configuration file. By default, this value is set to the storage/app directory.
所以你正在寻找文件:storage / app / Users / gk / Sites / mysite / public / badges / 1.png
错误很混乱.
[更新]
添加到config / filesystems.php
'disks' => [
//...
'local_public' => [
'driver' => 'local',
'root' => public_path(),
],
//...
],
然后
$filePath = 'badges/1.png';
$content = Storage::disk('local_public')->get($filePath);
dd($content);