https://github.com/laravel/framework/commit/24b705e105d22df014bee3aab7ff12272457771e
It’s possible this fixes this issue.
Going to upgrade to 7 and see if that changes anything...
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
https://laravel.com/docs/7.x/filesystem#the-public-disk
The below stores quick, fine and reliable using Spatie MediaLibrary.
'media' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage/',
'visibility' => 'public',
// 'root' => public_path('media'),
],
When I try this below it gives errors: League\Flysystem\FileNotFoundException: File not found at path: 161/5e9f84d32a983_Screen-Shot-2020-04-17-at-7.54.14-AM.png in /Users/trevorpan/code/bidbird/vendor/league/flysystem/src/Filesystem.php:389
'media' => [
'driver' => 'local',
'root' => storage_path('app/public/media'),
'url' => env('APP_URL').'/storage/media/',
'visibility' => 'public',
// 'root' => public_path('media'),
],
There's a https://laracasts.com/series/laravel-6-from-scratch/episodes/64 Jeffrey says be sure to store files in /app/public/avatars roughly at 13:11.
From the docs. I find this confusing. Do images directory automatically get put in the public?
'links' => [
public_path('storage') => storage_path('app/public'),
public_path('images') => storage_path('app/images'),
],
If you understand what's happening I'd like to know ~
I'll go back on what I said before. I said don't use env in your code - but of course using it in config files is fine because these can be cached.
So, there are two options;
use env('APP_URL') and ensure it is set correct in each environment
remove it and just rely on the path being simply relative to root. with 'url' => '/storage/media' then there is nothing to get wrong in the config. This is only an option if you correctly host in each location with public as the document root and therefore / is always the public folder.
Just one observation from your comment - "the numbered folders were stored in both places" remember that they are not. They are stored in one place (storage/app/public/media) but they are aliased to public/storage/media
Please or to participate in this conversation.