Problem with accessing local symbolic link in storage

Posted 1 year ago by JanakaDombawela

Hi,

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:

{{URL::to('storage/2017/10/file.txt')}}

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.

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

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.