Как получить файлы, расположенные в хранилище?
Я построил маршрут и направил его на myCcontroller@myMethod
. Метод ниже
public function myMethod()
{
$validPath = 'valid-path-inside-local-storage';
$file = Storage::disk(env('STORAGE_TO_USE','local'))->get($validPath);
return $file;
}
Но я получаю тарабарщину, вероятно, необработанные данные. Как заставить браузер отображать изображение, если файл является изображением, или загружать его, если файл, скажем, a.xls
?