FileUpload doesnt save to public

The problem is, the files only get saved to "storage/app/public" and not "public/storage". Therefore, you cant preview it or open it at all
FileUpload::make('attachment')
->required()
->multiple()
->columnSpan(2)
->disk('public')
->visibility('private')
->storeFileNamesIn('attachment_file_names')
->enableDownload()
->maxSize(25600)
FileUpload::make('attachment')
->required()
->multiple()
->columnSpan(2)
->disk('public')
->visibility('private')
->storeFileNamesIn('attachment_file_names')
->enableDownload()
->maxSize(25600)
I ran php artisan storage:link, and the url in .env is correct My filesystems file:
<?php

return [
'default' => env('FILESYSTEM_DISK', 'local'),


'disks' => [

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

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],

's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],

],

'links' => [
public_path('storage') => storage_path('app/public'),
],

];
<?php

return [
'default' => env('FILESYSTEM_DISK', 'local'),


'disks' => [

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

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],

's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],

],

'links' => [
public_path('storage') => storage_path('app/public'),
],

];
2 Replies
DarkKnight
DarkKnightOP14mo ago
I also have the same thing on my production site, and it works there... which raises even more questions 🤔
Azizbek Tursunov
Hi. DId you find solution?

Did you find this page helpful?