Problem with accessing local symbolic link in storage

Published 8 months ago by JanakaDombawela


I created my symbolic link with php artisan storage:link

I save my files in following function:

Storage::put( Carbon::now()->format( 'Y' ) . '/' . Carbon::now()->format( 'm' ), 'file.txt' );

My config/filesystems.php configurations:

'local' => [
            'driver' => 'local',
            'root' => storage_path('uploads'),
        'public' => [
            'driver' => 'local',
            'root' => storage_path('uploads'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',

The files are saved in the storage/uploads/2017/10 directory, which is what I want.

I access them as follows:


which outputs: http://localhost/mysite/public/storage/2017/10/file.txt and it gives 404.

When I try to enter http://localhost/mysite/public/storage it shows empty directory, not a 404.

Can you guys give any suggestions or ideas? Help is appreciated. Thanks.

8 months ago (151,680 XP)

@JanakaDombawela try

{{ Storage::url('2017/10/file.txt') }}}

@Dry7 This outputs: /storage/2017/10/file.txt but still 404 :(

8 months ago (897,225 XP)

the symbolic link command makes a link to storage/public so you should put your files there (or in a subfolder) or make an additional symbolic link

Please sign in or create an account to participate in this conversation.