Laravel File not found at path but it does exist Laravel File not found at path but it does exist php php

Laravel File not found at path but it does exist


I figured it out.

Storage::get actually uses the path relative to the filesystem disk configuration, therefore the error message itself is misleading.

I've corrected the issue by simply using file_get_contents() instead.


As others pointed out Storage::get indeed uses the path relative to the filesystem disk configuration, by default the local driver is used (config/filesystems.php):

'local' => [    'driver' => 'local',    'root' => storage_path('app'),],

So if you are using the local driver and your file resides at app/public/yourfile.ext for example then the call to Storage should be:

Storage::get('public/yourfile.ext');


Try this

$this->json = json_encode(app_path('/resources/generate/json/Car.json');