Php 正在尝试从应用程序文件夹而不是存储中检索Laravel文件夹中的文件
我试图读取文件夹中的文件,我在控制器中使用以下代码读取了文件Php 正在尝试从应用程序文件夹而不是存储中检索Laravel文件夹中的文件,php,laravel,eloquent,laravel-5.2,Php,Laravel,Eloquent,Laravel 5.2,我试图读取文件夹中的文件,我在控制器中使用以下代码读取了文件 $files = Storage::files('public'); 并使用 return view('scripts.index') ->with('files', $files); 我在storage/app/public文件夹中找到以下文件: 但是,我想读取ProjectName/app文件夹中的文件内容 我尝试通过更改下面的设置来更改config/filesystems.php文件,以允许
$files = Storage::files('public');
并使用
return view('scripts.index')
->with('files', $files);
我在storage/app/public文件夹中找到以下文件:
但是,我想读取ProjectName/app文件夹中的文件内容
我尝试通过更改下面的设置来更改config/filesystems.php文件,以允许从存储文件夹以外的其他位置进行读取,但无法找到它,这是默认情况下下面的当前代码
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
我希望能在这里阅读
试试
$file=app\u path(“Jobs/examplejobs.php”)
它不返回数组,因此在视图foreach中,我得到了为foreach()提供的代码无效参数(视图:/Users/Sita/Sites/automator/resources/views/scripts/index.blade.php)