I'm trying to store a file in the public folder storage/app/public/
but for some reason Laravel just seems to put it in the private storage/app/
folder.
If I understand correctly I'm supposed to just set the visibility to 'public' but that doesn't seem to change anything:
Storage::put($fileName, file_get_contents($file), 'public');
When I call getVisibility I get public so that seems to work fine:
Storage::getVisibility($fileName); // public
These are the settings in my filesystems.php:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
],
],